web Technology

Introducing HTML and XHTML

HTML (Hypertext Markup Language)

Even if you have never seen any HTML (Hypertext Markup Language) code, you may be familiar with the fact that it is used to create most web pages. There have been several versions of HTML since the Web began, and the development of the language is overseen by an organization called the W3C (World Wide Web Consortium). The last major version of HTML was HTML 4.01 in December 1999. In January 2000, some stricter rules were added to HTML 4.01, creating what is known as XHTML (Extensible Hypertext Markup Language)

Tags and Elements

you will see pairs of angle brackets containing the letters “ html ” Starting on the first line, the first angled bracket looks like a less - than sign, then there are the letters “ html ,” followed by a second angled bracket, which looks like a greater - than sign. The two brackets and all of the characters between them are known as a tag . In this example, there are lots of tags and they are all in pairs; there are opening tags and closing tags . The closing tag is always slightly different from the opening tag in that it has a forward slash after the first angled bracket: </html> . A pair of tags and the content these include are known as an element .

Separating Heads from Bodies

Whenever you write a web page in XHTML, the whole of the page is contained between the opening < html > and closing < /html > tags, just as it was in the last example. Inside the < html > element, there are two main parts to the page: Together, the < html > , < head > , and < body > elements make up the skeleton of an XHTML document — they are the foundation upon which every web page is built. Inside the < head > element of the first example page, you can see a < title > element: < head > < title > Popular Websites: Google < /title > < /head >

Example

    
        <!DOCTYPE html>    
        <html>        
            <body>            

                <p>        
                    This paragraph contains a lot of lines in the source code, but the browser ignores it.                    
                </p>        

                <p>        
                            This paragraph
                           contains      a lot of spaces
                    in the source     code,                    
                     but the    browser  ignores it.                  
                                                                 
                </p>        

                <p>        
                The number of lines in a paragraph depends on the size of the browser window.
                If you resize the browser window, the number of lines in this paragraph will change.        
                </p>

                </body>
                </html>