HTML-Basic tags
HTML stands for Hyper Text Markup Language. It is very popular and easy language to design basic web pages. HTML code is used to display different elements like tables, paragraphs on a web page. The elements are embedded in between angular brackets. The combination of angular brackets and element name is called as tag.
e. g. : <head></head>
HTML is not case-sensitive ,so <html> is same as <HTML> .
Tags are of 2 types
- container tag: This tag is just like a container having opening and closing tag. The content between opening and closing tag belongs to that element. <html></html> is the example of container tag.
- empty tag: This tag is just one lined
e.g. : <br> used to start from next line.
Structure of HTML:
The total HTML code is included in between <html></html>. Inside it, html code is divided into 2 parts.
- head part: <head></head>
In the head part , we write the title of the page, which is visible at the top of the browser page on the title bar. We can even mention the writers ,keywords, and some other important information between the head tag.
2. body part: <body></body>
This is the main part which helps to display the content on the web page.
We use many tags in body part . Let us see them one by one.
Before getting into the tags, we know that comments are very user friendly to understand logic or code. The syntax of the comment is: <! — text — >, text is where we insert our line.
Tags:
<html></html>:
This is a container tag , where the starting point of the html code starts from opening tag and ends at closing tag.
<head></head>:
The first part of the web page ,where the important information and title tag are inserted.
<title></title>:
Text that appears at the title bar, which is the title of that web page.
<body></body>:
The main part of the web page, where all other tags are written to design the page.
<p></p>:
This tag helps to display the content included between the tags, as a paragraph , by removing extra spaces.
<hr>:
A horizontal line is drawn.
<br>:
It breaks the line and starts from new line.
<a href=”URL”></a>:
It helps to insert a link , the url is assigned to href(hypertext reference) attribute.
<img src=”URL”>:
It inserts image in to the web page . The address or url is assigned to src attribute.
<div></div>:
It is a block section in the document.
<span></span>:
It is an inline section in the document.
<ul></ul>:
It is an unordered list tag ,where the list data is inserted in between the tags.
<ol></ol>:
It is used to display ordered list ,where the list items are included in between the tags.
<li></li>:
This tag displays the list items ,which are to inserted in <ul></ul> or <ol></ol>.
<dl></dl>:
It helps to display the definition list.
<dt></dt>:
This tag shows the definition term.
<dd></dd>:
Definition description is displayed by this tag.
<table></table>:
It is used to display the data in tabular format.
<tr></tr>:
Rows in a table are constructed.
<th></th>:
It shows the table heading .
<td></td> :
It is the column data which should be inserted in <tr></tr> and <th></th>
<pre></pre>:
This tag is used to display the content in raw format.
<b></b>:
It makes the text enclosed into bold format.
<i></i>:
Italian style is applied on the text.
These are the basic tags used in building html web pages. The code can we written in even notepad also, but saved with an extension of html. Web browsers are used to display the output of HTML code.
Thanking You.