What is an html document?
The web pages that we have all seen on the internet are in fact html documents, html is short for HyperText Markup Language, so what you actually see is a rendered version of a text file that contains html, in your browser.
HTML can be described as a "page description language", and that it describes how information is or should be rendered in a browser.
html is stored as a plain text file, and there is no formatting or special characters used to create an html file.
So an html file can be easily viewed in any simple text editor software/program such as Microsofts Notepad text editor program.
When an html document is opened in a browser the browser then proceeds to perform the following tasks.
-
The browser reads through the html in the file.
-
Then the browser displays the information in the browser window.
-
The browser then formats the results using the formatting commands within the html document itself.
-
Then the browser adds , images, links, and other external multimedia as instructed within the html document.
This demonstrates to us that the html document contains "instructions" for the browser which tell the browser how to "draw" the information in the browser window.
There are different versions of html and each of these versions has different instructions the browser can understand, and the number of instructions have been built upon and increased over several years of developement.
An html file has a very simple file structure , the file contains an Identifier which tells the browser it is reading an html file. The file also contains a Header this part of the file contains information for the browser and other agents for instance search engines.
The file also contains a Body this contains information that is to be displayed/rendered in the browser window, it contains the formatting instructions,links,images instructions ect.
Identifier
Header Information
Body Information
HTML uses the concept of a Tags to pass information to the browser, a tag is something that is enclosed by a less than symbol <, and a greater than symbol >, and is usually a word and looks like this <tag>.
There are lots of html tags that the browser understands, and there are various rules that govern the tags, these are defined within the html version that you use in your document.
Sometimes a tag does not hold enough information to be useful to the browser.
To enable a tag to provide more information the use of attributes is permitted.
For instance a <div> tag has a border attribute you can use this to control the border, for this element, or you can use the background-color attribute to change the colour of the background of the element.
The example below will make the background colour of the <div> element grey, just like the example above of an html files structure.
<div style="background–color:#d5d5d5;"> </div>
You can have more than one attribute for any one tag and these are defined in the version of html.
There have been a number of versions of html since it was first version was made available such as html 3.2, html 4.01 or xhtml 1.0
Attributes are usually formatted in this manner.
-
Within the enclosing < >
symbols/characters.
-
The attribute name ie border.
-
Then use an equals sign =
-
Open quotes "
-
value for instance border="10px"
-
Close the quotes "
-
<div border="10px;">
There are different types of tags these are block level and text level or inline tags.
The block level tags have an effect on a block of information and cause the information to be rendered on a new line.
The text level tag only has an effect on a little bit of text and does not cause a new line to be output. HTML needs to know when to start to apply the rules ect that the tag defines and when to stop applying the rules too.
So html uses the concept of start and end tags, and the rules are applied to all the text within the start and end tags.
Now that we have looked at the structure of an html document we can look at the tags that make up an html document/web page the 8 basic tags.
|