Friday, 10 March 2017

HTML Elements(Tags)

The HTML Tag:-
                           HTML tag is the root element of the HTML document.
It is a container element started by <HTML> tag and ended by </HTML> tag. It identifies the document as an HTML document. It does not have any effect on the appearance of the document, but tells the browser that the current document is an HTML document.

<HTML>
........ .........
</HTML>
HTML element further contains HEAD and the BODY elements, which can further contain a number of other elements.
The HEAD Tag:-
                         It is a container element started by <HEAD> tag and ended by </HEAD> tag. It defines the HTML document header and does not affect the appearance of the document in the browser window. The header contains information about the document.
<HEAD>
.................
</HEAD> 
The TITLE Tag:-
                             It is a container element started by <TITLE> tag and ended by </TITLE> tag. Every HTML document should contain the title to be displayed in the title bar of the browser window. If an HTML document does not contain a title, then the file name of the HTML document is displayed in the title bar. 

<TITLE>
...............
</TITLE> 

The BODY Tag:-
                            It is a container element started by <BODY> tag and ended by </BODY> tag. It contains the main contents of the document as parameter. 
<BODY> 
................
</BODY>  

BODY tag contains many attributes.

P (Paragraph) element: - 
                                         It is a container element started by <P> tag and ended by </P> tag. This element is used to start a new paragraph. HTML does not recognize the return/enter key we enter in text editor; therefore we use <P> tag to start a new paragraph. <P> starts a new paragraph with extra space before the first line.
Syntax:

 <P ALIGN="alignment" lang = "language"> . . .</P>

ALIGN attribute specifies the horizontal alignment of paragraph. Any of the alignments - Center, Left, Right - can be specified.
LANG attribute specifies the language in which the paragraph is to be displayed as discussed above.

Horizontal Rule (HR) element :-
                                                     This is an empty element specified by <HR> tag. The <HR> tag draws a horizontal line across the document frame or window. We can use a horizontal line to visually divide the information into sections.
Syntax:
 
<HR ALIGN = "alignment" NOSHADE SIZE = "thickness" WIDTH = "width" COLOR="colorname" >
Attributes of < HR > tag:-
 
ALIGN:-Specifies how the horizontal rule should be aligned. The alignment can be left, right, or center. Default is center alignment.

NOSHADE:-produces a solid horizontal rule that has no shading.

Size:-Size defines the thickness of the horizontal rule. This thickness is specified in the number of pixels. Default is 2 pixels.

Width:-"Width" defines the horizontal width of the line. The default is the width of the page. The measurement value can be the number of pixels, e.g., "50" , or a percentage of the page width, e.g., "75%".

Color:-Sets the colour of the horizontal line.

Line Break (BR) Element :-
                                             This is an empty element specified by <BR> tag. <BR> tag forces a line break which implies that the text/image following the tag will be moved to the next line when displayed in the browser.
Syntax:
  <BR>

1 comment: