Select Page

HTML is short for HyperText Mark-up language. HTML is used to write the content of a website. It is called a HyperText because the text have links or hyperlinks to other texts. It is called a mark-up language because the language uses tags to mark text as specific type of text. Example, the statement <h1>Web development</h1> uses the HTML tag <h1> to mark the text “web development” to be formatted with a certain font. This is an h1 header font. 

HTML Elements

HTML elements provide semantic meaning. They also provide machine readability to the content in the page. An html element typically consists of an opening tag and a closing tag. The tag comprises the element name sandwiched between two opposite facing angle brackets. 

Empty or void elements

These are html elements that do not have closing tags or any content. Examples include <img>, <meta> , <link> , <input> 

HTML elements names are simple descriptive names for the content they contain. Example include header, footer, audio, video etc

HTML element tags consist of the element name sandwiched between two opposite facing angle brackets. Examples include <header></header>, <footer></footer>, <audio></audio>, <video></video>

Thus, the element normally have an opening and a closing tag. The opening tag comprises the elements name sandwiched between two opposite angle brackets. Example include <header> , <footer> 

The closing tag (Example, </header> ) is identical to the opening tag, <header> , except that there is a forward slash between the opening angled bracket and the element.

Hello World using HTML

Line 1:  specifies the document type. This helps browsers to identify the type of HTML

Line 2: <html> opening tag delimeters the start of the html code. All html code must be withing the <html></hmtl> tag

Line 3: <head> is the opening tag for the head of the document. The <head> tag in HTML is used to define the head portion of the document which contains information related to the document. The <head> tag contains other head elements such as <title>, <meta>, <link>, <style> <link> etc.

Line 4: The <title> tag contains the title of the document. It sets the title in the browser toolbar. In our code, the title of our document is This is the title of the document

Line 5: </head> is the closing tag for the <head> tag. It marks where the <head> tag ends

Line 7-9:  The <body> tag contains the main content of the web page. In our example, the content of ur page comprises a heading: <h1>This is the heading</h1> and <p>Hello World</p>. The main body of the document ends at the tag </body>