SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    SitePoint Member
    Join Date
    Jul 2011
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Beginner - following sitepoint book Build Your Own Website The Right Way

    Page 29-31
    I have copied the example text into Notepad but when I open in Firefox it does not display a webpage, just the HTML. What could I be doing wrong?

    I am a complete beginner and no advice is too basic for me!

  2. #2
    SitePoint Wizard bronze trophy Black Max's Avatar
    Join Date
    Apr 2007
    Posts
    4,029
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Welcome to SitePoint! You're in the right place for help.

    Did you save it using the .html extension?

    mypage.html
    I can't be more specific because I don't have the book.

  3. #3
    SitePoint Member
    Join Date
    Jul 2011
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for swift reply!

    Yes - I saved as basic.html and UFT-8 from the drop down (Plain Text Encoding) as the book says

  4. #4
    SitePoint Member
    Join Date
    Jul 2011
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this is the html I wrote:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C/DTD XHTML 1.0 Strict//EN"
    		"http://www.w3.org/TR/xhtml1/DTD?xhtml-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    	<head>
    		<title>The Most Basic Web Page in the World</title>
    		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    </head>
    <body>
    		<h1>The Most Basic Web Page in the World</h1>
    		<p>This is the very simple web page to get you started. Hopefully you will get to see how the markup that drives the page relates to the end result that you can see on screen.</p>
    		<p>This is another paragraph, by the way. Just to show how it works.</p>
    	</body>
    </html>
    Last edited by Black Max; Jul 21, 2011 at 13:35. Reason: added code tags

  5. #5
    SitePoint Wizard bronze trophy Black Max's Avatar
    Join Date
    Apr 2007
    Posts
    4,029
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    I was able to save and open it in Opera without difficulty. Hmmmm.

  6. #6
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    You have three typos in your code:

    Quote Originally Posted by Erroneous markup
    <!DOCTYPE html PUBLIC "-//W3C/DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD?xhtml-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    Should be be written as follows:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml">
    I'll give you a tip for the DOCTYPE, i.e. this code sample in this post copy and paste a correct Doctype (those three lines) rather than typing it all by hand - not even I bother typing out that part in full... I've highlighted the 3 corrections too.

    However, that won't effect it from rendering in Fx. thus most probable the reason you are seeing markup and not the actual webpage is probably because your file extension is still *.txt and not *.html You might have accidentally have a file called: basic.html.txt

    One easy way to findout, is to look at the Firefox address bar URL and see if the file you load ends in *.html your file should be called basic.html and nothing else.

    Double-check it has the *.html extension as sometimes people accidentally leave the extension *.txt in place on the end when is should be be *.html

  7. #7
    SitePoint Member
    Join Date
    Jul 2011
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you
    You are right about the address bar as it does show a .txt but I am unable to save the file as anything else in Notepad. It offers a 'txt' file or an 'All files' option the all files optiion does not seem to do the trick. When searching for it it comes up as basic.html only but the address bar shows it ending in .txt as you predicted. How should I correct that?

  8. #8
    SitePoint Wizard rguy84's Avatar
    Join Date
    Sep 2005
    Location
    Durham, NC
    Posts
    1,659
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    You will need to show file extentsions in windows. Open any folder, click tools, folder options, view tab. A few options down, there will be hide known extentions - untick it. Hit apply. Right click your file, choose rename. Delete the .txt, and type .html, hit ok/yes to the prompt. open it FF
    Ryan B | My Blog | Twitter

  9. #9
    SitePoint Member
    Join Date
    Jul 2011
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i have windows XP and i am unable to do as you suggest. there is no 'hide known extensions' check box. Is there another way do you think?

  10. #10
    SitePoint Member
    Join Date
    Jul 2011
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have now saved the html scipt again in a new notepad document and i have finally achieved the result I was supposed to get.

    Thank you all very much indeed for your advice that put me on the right track.

    This is truely an amazing resource you all provide. (No doubt I will be back!)

    Very much appreciated.
    Ady Cole

  11. #11
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    No worries Ady, hundreds of people make that mistake regarding that book or for that matter a lot of beginners. When you get onto external CSS files around page [79] you do similar but save as *.css instead of the *.html extension.

  12. #12
    SitePoint Wizard bronze trophy Black Max's Avatar
    Join Date
    Apr 2007
    Posts
    4,029
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Or use Notepad++ (free) that lets you save files as a bunch of different types, including HTML and CSS.

  13. #13
    SitePoint Member
    Join Date
    Jul 2011
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Top notch - thanks again!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •