HTML Chapter 1 Introduction
HTML Chapter 1 Introduction
<HTML>
<HEAD>
HEAD SECTION
</HEAD>
<BODY>
ACTUAL Documents
</BODY>
</HTML>
HEADING
DEFINATION:-
Heading are very important Tag in the BODY of
HTML document. It is used to display different
types of heading.
SYNTAX:-
<Hn> Your Text </Hn>
Where n Is the size of the heading. Its value is
from 1 to 6.The value 1 is represent the largest
and the value 6 represent the smallest heading
size.
ATTRIBUTES OF HEADING
ALIGN:-
It specifies the alignment of the heading . The
possible values are center, left and right. The default
value is left.
Example:-
<H1 ALIGN=“CENTRE”>Hello Heading </H1>
PARAGRAPH
Definition:-
Paragraphs are used to add text to a document in
such a way that it will automatically adjust the end
of line to suit the window size of the browser. Each
line of text will stretch the entire length of the
window. It defined with the <p>tag. The use of
ending tag </p> is optional.
Example:-
<p> I am Paragraph.</p>
ATTRIBUTES OF PARAGRAPH
ALINE:-
It specifies the alignment or
paragraph. The possible values are center,
left and right.
Link
LINE BREAKS
Definition:-
Line Breaks are used to decide where the text will break
on a line or continue to the end of the window. It can be
used to move the control to the next line. The <BR> tag is
used to end a line without inserting a new
paragraph.<BR> has no closing tag.
Example:-
Sentence One <BR>
Sentence Two<BR>
Sentence One
Sentence Two
THE POEM PROBLEM
<p>
My Bonnie lies over the ocean.
<pre>
My Bonnie lies over the ocean.
</body>
</html>
HORIZONTAL LINE
Definition:-
Horizontal lines are used to separate different areas of the web
page. It is used to display a horizontal line in the page. The tag for
horizontal line is <HR>. This tag has no closing tag
Attributes:-
1. ALIGN: It specifies the alignment or paragraph. The possible
values are centre , left and right.
2. SIZE: It specifies the size of the line . The default size is 2 pixels.
OUTPUT:-
Link
TEXT FORMATTING
BOLD:-
<B> tag is used to display text in bold face style. It is
closed by </B> tag.
Example:-
<b> It Is a Bold Style </b>
ITALIC:-
<I> tag is used to display text in italic style. It is closed by
</I> tag
Example:-
<I> Italic text looks stylish.</I>
Underline:-
<U> tag is used to display text as underlined. It is closed by </U>
Example:-
<U> Underline text looks prominent. </U>
Superscript:-
<SUP> tag is used to display text as superscript. It is closed by
</SUP> tag.
Example:-
10<SUP>2</SUP>
Subscript:-
<SUB> tag is used to display as subscript. It is closed by </SUB>
Example:-
H<SUB>2</SUB>O
OUTPUT OF THE TEXT FORMATTING
Link
STRIKE TEXT
Link
INSERTED AND DELETE TEXT
Anything that appears within <ins>...</ins> element
is displayed as inserted text.
Anything that appears within <del>...</del> element,
is displayed as deleted text.
Link
LARGER AND SMALLER TEST
The content of the <big>...</big> element is displayed one
font size larger than the rest of the text surrounding it as
shown below −
The content of the <small>...</small> element is displayed
one font size smaller than the rest of the text surrounding it
as shown below −
<!DOCTYPE html>
<html>
<head>
<title>Smaller Text Example</title>
</head>
<body>
<p>The following word uses a <small>small</small> typeface.</p>
<p>The following word uses a <big>big</big> typeface.</p>
</body>
</html>
Link
FONTS
Definition:-
<FONT> tag is used to specify the characteristics of
font. Different characteristics include the typeface, size
and color. It closed with </FONT> tag.
Attributes:-
FACE:- It specifies the font of the text. The possible
values are “Arial ”, “Arial Black” and “MS sans Serif”
etc.
Link
SPACES
Definition:-
If an HTML document has many spaces,
additional spaces are removed automatically. If the
user inserts five spaces, four of them will removed.
Additional spaces can be inserted in the text by using
character entity that stands for non
breaking space.
Example:-
<B> Hello World </B>
the above example will display Hello World
× Multiplication ×
÷ Division /
<DIV> TAG
Definition:-
<DIV> tag is used to define a section in an HTML document. It
can be used to group large section of HTML elements together
and format them with cascading style sheet. The closing tag
</DIV> is used to indicate the end section.
Attributes:-
ALIGN: It specifies the alignment of the DIV. The
possible values are center, left and right.
The default value is left.
Title:- Now let us try to add one title to this div tag. On
mouse over the div area title text will be displayed like
alt tag of images. Here is the code
DIV TITLE
<div title="This is a test for title on Div tag">
This is a right aligned text2 </div>
Link
EXAMPLE OF <DIV>:-
<HTML>
<BODY>
<DIV STYLE=“background-color:orange;text-align:center”>
<p> It’s My Style </p>
</DIV>
</BODY>
</HTML>
EXAMPLE OF <DIV>:-
Link
Note:
STYLE=“background-color:orange; color:orange”
STYLE=“color:orange”
PAGE STRUCTURE USING DIV
PAGE STRUCTURE USING DIV
PAGE STRUCTURE USING DIV
PAGE STRUCTURE USING DIV
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css"
href="mystyle.css">
</head>
<body>
<div id="wrapper">
<div id="header">
<div id="logo"></div>
</div>
<div id="navbar"></div>
<div id="container">
<div id="left-panel"></div>
<div id="right-section"></div>
</div>
<div id="footer"></div>
</div>
</body>
</html>
PAGE STRUCTURE USING CSS
/* Zahid Javed */
*{padding: 0; margin: 0;}
#wrapper{border: solid;}
#header{height: 100px; background-color: bisque; padding: 10px;}
#logo {width: 150px; height: 100px; background-color: brown;}
#navbar {height: 50px;background-color:blueviolet; margin-top: 10px;}
#container{border: solid red; margin-top: 10px;}
#container::after{content: " "; display: block; clear: both;}
#left-panel{width: 25%; height: 600px; background-color: beige; float: left;}
#right-section{width: 74%; height: 600px;background-color:aquamarine; float:
right;}
#footer {height: 100px; background-color: green; margin-top: 10px}
<SPAN> TAG
Definition:-
<SPAN> tag is used to provide additional structure to HTML
document. It is used to group and apply styles to inline
elements. it can be used to give different characteristics to
specific parts of other elements. The HTML span element
begins with <SPAN> tag and ends with </SPAN> tag. A
style can be applied to the content placed inside the SPAN
tag using STYLE attribute.
Example:-
<p> This is a paragraph
<SPAN STYLE=“color:#FF0000;”>This is a paragraph
</SPAN> This is a paragraph </p>
Link
<MARQUEE> TAG
Definition:-
HTML provides a special feature to display
scrolling and animated text in the web page. This tag
is supported by Internet Explorer, Firefox and
Netscape 7 and above. Netscape has a blink tag to
display blinking text but Internet Explorer does not
support blink tag.
Link
MARQUEE FONT
<!DOCTYPE html>
<html>
<body>
</body>
</html>
Link
Attributes:-
BEHAVIOR: It indicates how the contents will scroll.
The possible values are scroll, slide and alternate.
The scroll value is the default value. It indicates that
the content scrolls off the edge of marquee area and
then reappears on the other side.
<!DOCTYPE html>
<html>
<body>
<marquee behavior="scroll">This text will scroll with behavior
scroll</marquee>
<marquee behavior="slide">This text will scroll with behavior
slide</marquee>
<marquee behavior="alternate">This text will scroll with behavior
alternate</marquee>
</body>
</html>
Link
Attributes:-
BGCOLOR: It is used to set the background color of
the marquee. Its value can be given as a combination
of red, green and blue or name of the color. The
hexadecimal value of the color can also be used.
Link
color code chart
http://www.rapidtables.com/web/color/red
-color.htm
Attributes:-
DIRECTION: It indicates the direction to which the
marquee will scroll. The possible values are up, down,
left and right. The default value is left. The left value
indicates that the marquee starts at the right and moves
to left across the page. The right value indicates that the
marquee starts at the left and moves to right across the
page.
Link Link
Attributes:-
HEIGHT: It defines the height of marquee. It is given in
pixels or percentage.
HSPACE: It is used to set the horizontal space to the left
and right of the marquee. Its value is given in pixels.
WIDTH: It defines the width of marquee. It is given in
pixels.
VSPACE: It is used to set the vertical space at the top
and bottom of the marquee. It is given in pixels.
<!DOCTYPE html>
<html>
<body>
</body>
</html>
Link
WIDTH="25%"
HSPACE=10 WIDTH="25%"
HSPACE=50 WIDTH="25%"
Page Width
WIDTH="25%"
HSPACE=10 WIDTH="25%"
HSPACE=50 WIDTH="25%"
Marquee VSpace
VSPACE sets the space between the marquee and text before and after. These
code examples show the default value of VSPACE (also 0) and two larger values:
VSPACE=10
VSPACE=50
Link
Marquee Width and Height
WIDTH and HEIGHT set the dimensions of the marquee.
This code creates a marquee that is 200 pixels wide and 150 pixels
tall. The default value for WIDTH is 100%. The HEIGHT defaults to
the natural height of content as it appears in the width.
<!DOCTYPE html>
<html>
<body>
</body>
</html>
Link
LOOP: This specifies how many times to loop. The default value is
INFINITE, which means that the marquee loops endlessly.
<!DOCTYPE html>
<html>
<body>
<MARQUEE LOOP=2>Hello</MARQUEE>
</body>
</html>
The Scrolldelay Attribute
SCROLLDELAY, together with SCROLLAMOUNT, sets
the speed of the scrolling. Marquee moves the content by
displaying the content, then delaying for some short period
of time, then displaying the content again in a new
position. SCROLLDELAY sets the amount of delay in
milliseconds (a millisecond is 1/1000th of a second). The
default delay is 85.
The following examples show the default SCROLLDELAY
(i.e. when it is not set), a value of 500 (half a second) and
1000 (one full second).
Link
<MARQUEE>Hello</MARQUEE>
<MARQUEE SCROLLDELAY=500>Hello</MARQUEE>
<MARQUEE SCROLLDELAY=1000>Hello</MARQUEE>
SCROLLAMOUNT: It is used together with
SCROLLDELAY to set the speed of the scrolling. Marquee
moves the content by displaying the content and then delays
for some period of time specified in SCROLLAMOUNT that
sets the size in pixels of each jump. A higher value for
SCROLLAMOUNT makes the marquee scroll faster. The
default value is 6.
<MARQUEE>Hello</MARQUEE>
<MARQUEE SCROLLAMOUNT=20>Hello</MARQUEE>
<MARQUEE SCROLLAMOUNT=50>Hello</MARQUEE>
Link
<HTML>
<BODY>
<FONT SIZE=“8” FACE=“courier” COLOR=blue>
</BODY>
</HTML
<MARQUEE> Tag
Link
STYLE
Link
HTML FONTS AND TEXT SIZE
HTML TEXT COLOR & ALIGN
MARQUEE SPEED (CSS)
Speed:
Specifies the speed in which the text in the
marquee moves. Possible values are Delay or
Amount
Delay:
This specifies how long to delay between each
jump. This attribute takes the time in
milliseconds.
Link