A browser read absolutely all you write in the HTML document. Tags have three parts as I said before, the opening, closing and content.
As you will learn there are hundreds of HTML tags. Absolutely all the elements that will be displayed by a browser need a tag or two.
Tags are written in small letters. This is the standard of writing in XHTML, and Dynamic HTML.
Above are some examples of tags in HTML.
<body> <!--acts as a capsule on the content.--> <p>paragraph</p> <h2>Title (heading)< h2> <i>italic</ i> <b>bold</b> </body>
Exceptions – tags that do not require closing tag
There are some tags that do not meet the model shown above.The reason is that in fact these tags do not have content. Due to this fact we will use a modified manner of writing these tags.
The simplest example is “linebreak”
This tag is combining the two tags, opening and closing.This way is more efficient to use. Line break is used to tell the browser that we want to get down a line below, but not closing paragraph.
Following this example, other tags have been modified to be write in a simpler and quicker way.
<img src="../img/image.jpg" /> -- Image Tag -- <br /> -- Line Break Tag -- <input type="text" size="12" /> -- Input Field --
As you can see the browser is able to reproduce the image as long as we provide the location using the attribute “scr”. More about this in the next tutorial.