Results 1 to 1 of 1

Thread: Anatomy of an HTML File

  1. #1
    Join Date
    Nov 2009
    Posts
    76,596

    Default Anatomy of an HTML File

    You understand what tags and container tags are, here's how to make an HTML file the right way: identify your file as an HTML file by enclosing the entire thing in the <html> container tag-- in other words, stick an <html> start tag at the top of your file and an </html> end tag at the bottom.

    Technically, the <html> tag can only contain two things: a <head> container tag, and a <body> container tag. Inside the <body> tag is where you put your whole page. All displayed text, images, hyperlinks, and so on, are contained between the <body> and </body> tags.

    The optional <head> section, placed before the <body> section, lets you store certain information about the document itself. When the <head> section even exists at all, it might contain only the <title> container tag, which says what to display in the title of the browser window, above the menu bar (if you have a graphical browser). For example, this page has a title of "HTML Made Really Easy".

    So a simple "hello, world" HTML file, with title, would be

    Code:
    <html>
    
    <head>
    <title>hello, world</title>
    </head>
    
    <body>
    hello, world.
    </body>
    
    </html>
    don't want a title, leave out the lines beginning with <head>, <title>, and </head>.

    If this is confusing, Just stick the text <html><body> at the beginning of your file and </body></html> at the end, and it will magically become a legitimate HTML file.


    [HTML Tutorial] Heading, h1, h2, h3, h4, h5 and h6 Tags
    What is HTML
    Last edited by sherlyk; 03-21-2014 at 06:24 AM.

Tags for this Thread

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
  •