Monday, 21 July 2014

Moving a step further...

On my last post, we were able to create a basic page just to see something work. You may have not understood some of the processes involved or the tags used in the code(I mean all he less and greater than sign <, > with the forward slashes /)

Syntax

Just like in English Language, HTML has Syntax. Syntax is a set of rules that govern the arrangement of elements in a document. Our document here is our HTML script. The elements in the document are building blocks that play a particular role.

Opening and closing tag

The syntax for opening and closing a tag is as follows:
Opening Tag: < element>
Closing Tag: </element>


 Useful Elements

Tags are the building blocks of HTML. Tags open and close and they are nested in each other. i.e   the <html> tag opens, closes </html> and it will house other tags within it. You will get a better understanding of this on an earlier post, the structure of a basic HTML page.

<!DOCTYPE html>


This is the first thing in an HTML document. It is a declaration  that helps the computer identify which version of HTML you are using. It is not an HTML element, this accounts for the reason why it does not have a closing tag.

<html>  </html> and <body></body>


The main element in an HTML document is the <html></html> element. Everything inside a webpage is nested inside the html document.
The body element contains the actual content of the web page. Everything nested or typed inside <body>  and  </body> shows up in the web browser.

<h1>


There are six levels of heading elements:
H1
H2
H3
H4
H5

H6
The <h1> element is used to describe the main heading of the page.

You can see other elements here

No comments:

Post a Comment