Creating Simple Web Pages Help

Discussion in 'Mac Basics and Help' started by dukeofism, Jul 22, 2009.

  1. dukeofism macrumors member

    Joined:
    Jul 22, 2009
    #1
    I have been making webpages for a while, though I am no pro. I recently got a new MBP and decided today to try making a web page (to try out some php that I started learning ~5minutes ago). I could not figure out how to add php to my pages created in iWeb (though i still love the program). I decided to go back to basics with just TextEdit (which is presume is the mac variant of 'notepad'). When i create my file in Text edit that looks as follows

    -----
    <html>
    <body>
    Hi
    </body>
    </html>
    ------

    and save that file as firstpage.html . I get and error (atleast what i think to be an error) when I open the file "firstpage.html" with both safari and firefox. The un expected event is both safari and firefox displaying the file as:

    ------
    <html>
    <body>
    Hi
    </body>
    </html>
    ------
    and not:
    -------
    Hi
    -------

    Is there something I am missing here? or not doing correctly?
    Thanks!

    P.S.
    -Sorry if I am posting this in the wrong forum. I thought this was a bit to "basic" to be posted in the forum for web design and development.
     
  2. motulist macrumors 601

    motulist

    Joined:
    Dec 2, 2003
    #2
    I bet you have your computer set to not display file extensions. So since you saved this text file through textedit, even though you named the file as whatever.html in reality the file name is whatever.html.txt but you aren't seeing the ".txt because you have your computer set to not display file extensions.

    To fix the problem you can either change just the extension on this particular file, or you can set the computer to always display file extensions in the file names. (I recommend the latter method if you're not a really super basic computer user). Tell me which method you would like to do and I'll tell you how to do it.
     
  3. dukeofism thread starter macrumors member

    Joined:
    Jul 22, 2009
    #3
    Thanks for the Info. I'd like to know how to have my computer to always display extensions
     
  4. dukeofism thread starter macrumors member

    Joined:
    Jul 22, 2009
    #4
    When I get info about the file, it says under "general" that it is an HTML document...

    Shouldn't it in fact then, display it as a webpage...?
     
  5. dukeofism thread starter macrumors member

    Joined:
    Jul 22, 2009
    #5
    I just figured out how to get the file extensions always displayed-- through the finder preferences. My file is defintitely saved as a .html
     
  6. motulist macrumors 601

    motulist

    Joined:
    Dec 2, 2003
    #6
    Open the file in text edit, and make sure the format is set to plain text, and not to rich text. If it's a plain text file, and when all extensions showing the file name is whatever.html, try dragging and dropping the file onto the safari icon again (rather than opening the file through safari's menu bar > "open" command). And tell us if that works, or if it doesn't. If it doesn't, then upload the html file here to the forum so we can look at the file ourselves and tell you what the problem is with it.

    EDIT, and there are some problems with your code that can be causing the problem. You didn't close the head. After <html> write <head> </head> (iirc. It's been a LONG time since I did web page editing)
     
  7. dukeofism thread starter macrumors member

    Joined:
    Jul 22, 2009
    #7
    Thanks! i got it figured out. Converting to a plain text did the trick
     
  8. motulist macrumors 601

    motulist

    Joined:
    Dec 2, 2003
    #8
    Glad I could help.
     

Share This Page