Essential HTML tags
Let us have a detailed discussion on the essential tags required to create web pages. The tags, their use, associated attributes and their values, and their appearance in the browser window will be illustrated in this section.
The value of Bgcolor attribute can be given in two ways.
Link: This attribute specifies the colour of the hyperlinks that are not visited by
the viewer. The default colour for link attribute is blue.
Alink: It specifies the colour of the active hyperlink. The link remains active only for the moment the mouse is clicked on it. Hence at the time of selection
the colour of the link will be changed to Alink value. The default Alink
colour is green.
Vlink: It specifies the colour of the hyperlink which is already visited by the
viewer. the default colour for Vlink is purple.
<HTML>-starting an HTML page
The entire HTML document is bounded by a pair of <HTML> and </ HTML> tags. The <HTML> tag identifies the document as an HTML document. In general <HTML> is always the first tag in an HTML page and the</HTML> is the last tag. Everything else in the web page is in between these two tags. That is,the Head section and the body section lie inside the <HTML>and </HTML> tags. It is a container tag pair. The main attributes of the <HTML> tag are Dir and Lang.
Dir
The Dir attribute of <HTML> tag specifies the direction of the text to be displayed on the web page. This attribute can have values either Ltd (left-to-right) or rtl (right-to-left).By default, the value of this attribute is l t r. The value r t l is used when languages like Arabic, Hebrew, Chinese etc. are used for content presentation. For example, <HTML Dir= "rtl"> specifies that the document is to be read from right-to-left.
lang
The Lang attribute of <HTML> tag specifies the language we have generally used within the document. The value "in" is used for English language and "it" is used to specify Italian language.
For example, the code <HTML Dir = "at" > specifies that the language used in the HTML document is Arabic language. Some common language codes used with lang attribute are given in Table
SL.No | Code | language |
---|---|---|
1 | En | English |
2 | Fr | French |
3 | De | German |
4 | It | Italian |
5 | El | Greak |
6 | Es | Spanish |
7 | Ar | Arabic |
8 | Ja | Japanese |
9 | Hi | Hindi |
10 | Ru | Russian |
<HEAD>-Creating head
It contains the head of an HTML document, which holds information about the document such as its title, scripts used, style definitions, etc. The tag pair <HEAD> and </HEAD>declares the head section. It is also a container tag pair <HEAD>and </HEAD> declares the head section. It is also a container tag pair.
<TITLE>-Creating a title
It is a container tag pair that contains the title of the HTML document, which will appear in the web browser's title bar. The search engine uses the Title to identify the page. The tag pair<TITLE> and </TITLE> is used inside the tag pair <HEAD> and </HEAD> to mention the document title.
<BODY>-Creating a body
The body tag pair <BODY> and </BODY> specifies the document body section. This section contains the content to be displayed in the browser window. Hence, all other tags, which define the document content are given in the body section. Before discussing these tags, let us discuss various attribute of <BODY> tag.
Background
This attribute sets an image as background for the documents body. This attribute of <BODY> tag makes the page more attractive. The general format is:
<BODY Background =
"URL of the picture">
The HTML code given in example shows the sky as the background image of a web page.
Bgcolor
This attributes specifies a color for the background of the document body. For example , <BODY Bgcolor = "yellow" > will display the background in yellow color.The value of Bgcolor attribute can be given in two ways.
- Color_name-specifies the background color with a colour name (like"red","grey" etc.)
- Hex_number- specifies the background color with a hexadecimal code (like "#ff6080","#303030" etc.). Each hexadecimal code will be preceded with a hash sing#.
Text
This attribute specifies the color of the text content in the page. By default the browser displays the text in black colour on a white/grey background. We have already discussed how to change the background colour using Bgcolor attribute. Simillarly the colour of the text can be changed using the attribute text. For example, <BODY Text ="yellow" > shows the text in yellow colour. Like Bgcolor, the value of text attribute can be given as a colour name or hexadecimal code. For example, Text = "Blue" or Text = "#00FFDD" etc.Link,Alink and Vlink
A hyperlink is an element, a text or an image that we can click on, and jump into another document or another section of the same document. A hyperlink points to a whole document or to a specific element within a document. We will discuss hyperlink in detail later in this chapter.Link: This attribute specifies the colour of the hyperlinks that are not visited by
the viewer. The default colour for link attribute is blue.
Alink: It specifies the colour of the active hyperlink. The link remains active only for the moment the mouse is clicked on it. Hence at the time of selection
the colour of the link will be changed to Alink value. The default Alink
colour is green.
Vlink: It specifies the colour of the hyperlink which is already visited by the
viewer. the default colour for Vlink is purple.
Comments
Post a Comment