Level 2
Level 2
• The tags are coded by HTML commands or keywords that indicate how
web browser should format and display the content.
• All HTML tags should be specified within angle brackets (< >).
Ex:<HTML> is a tag.
HTML Document Structure
• HTML tags have an opening an closing tag
surrounding the text.
• Step 2: In the appearing Note pad / Text Editor, type the HTML document.
• In “file name” text box, type a file name with .htm or .html
extension.
• Select “All files” from “Save as type” list box.
• Select View Page Source (Firefox and Chroma)/ View Source (Internet Explorer) or Press
Ctrl + U (all browser)
• Source file will be displayed.
• After modify and save the source file, minimize your source file.
• Go to the browser.
• Click Refresh (Internet Explorer)/Reload Current page (Firefox)/ Reload this page
(Chrome) icons on the address bar.
• The <html> tag is used to specify the beginning and closing of an HTML
document.
• HTML has two attributes, dir and lang to specify the text direction and language
setting respectively.
Attributes of <html> tag Ltr (Align left-
to-right)
dir
Predefined
lang code language
English-en
Attributes of <body> tag
Background colour:bgcolor=color
• All the browsers display the text on white background.
• Tag to change background colour:
<body bgcolor = color_name/color_code>
• Colors in HTML are represented as six digit hexadecimal values.
• The six digit hexadecimal value is the combinations of three, two digit number
sequence represent a color.
• First two digits represent Red, next two digits for Green and last two digits for
Blue (RGB) in the range of 00 – FF
• For example,
FF0000 is bright red, 000000 is black and FFFFFF is white.
Background colour:bgcolor=color
HTML code to change the background colour
Program for changing the background color
Body text colour: text = color
<body background =
“image_name_with_extension”>
Setting Margins: margin=value
• The margin refers the blank area
from left or top edge of the browser
window.
• There is no default margin setting in
any browser.
• Tag to specify the left and top
margin:
• <body leftmargin = value
topmargin = value>
• The Value is referred as pixels (72
pixels to an inch)
Headings
• Headings are used to include titles to
sections of a web page.
• HTML has six levels of headings viz. <h1>
to <h6>. h indicates the level of heading.
• Header tags are display the body text as
bolder and larger in size according to its
level.
• The syntax of heading tags:
<h…> Heading text </h…>
Attribute of Headings tag
• Align is an attribute to set right, center
and justify alignment to headings. Left is
the default alignment.
• The content what you type between <p> and </p> is identified as a paragraph
and display as a paragraph by the browser.
• Comments are used to describe the page or provide some kind of indication of
the status of the page. The tag <!> is used to create comments.