Professional Documents
Culture Documents
HTML LAYOUT
HTML FONTS
HTML STYLES
HTML HEAD
HTML SCRIPTS
HTML LAYOUT
You may not want to see your webpage behaving differently when viewed at
different resolution or when a browser window is resized.
Absolute width – keeps the elements in your tables intact regardless of window
size or screen resolution. (Width in absolute pixel values)
<html>
<head><title>ABSOLUTE WIDTH </title></head>
<body><h1><center> ABSOLUTE WIDTH </center> </h1>
<table border=0 width=550 cellpadding=10 align=center>
<tr>
<td width=50% valign=top>
This is some text in two columns. This is some text in two columns. This is some text in two
columns.
This is some text in two columns. This is some text in two columns. This is some text in two
columns.
This is some text in two columns. This is some text in two columns. This is some text in two
columns.
</td>
<td width=50% valign=top>
This is some text in two columns. This is some text in two columns. This is some text in two
columns.
This is some text in two columns. This is some text in two columns. This is some text in two
columns.
This is some text in two columns. This is some text in two columns. This is some text in two
columns.
</td>
</tr>
</table>
</body>
</html>
RELATIVE width – does not keep the elements in your tables intact. (Width in
Relative Percentage values)
<html>
<head><title>ABSOLUTE WIDTH </title></head>
<body><h1><center> RELATIVE WIDTH </center> </h1>
<table border=0 width=100% cellpadding=10 align=center>
<tr>
<td width=50% valign=top>
This is some text in two columns. This is some text in two columns. This is some text in two columns.
This is some text in two columns. This is some text in two columns. This is some text in two columns.
This is some text in two columns. This is some text in two columns. This is some text in two columns.
</td>
<td width=50% valign=top>
This is some text in two columns. This is some text in two columns. This is some text in two columns.
This is some text in two columns. This is some text in two columns. This is some text in two columns.
This is some text in two columns. This is some text in two columns. This is some text in two columns.
</td>
</tr>
</table>
</body>
</html>
HTML FONTS
In this lesson we will talk about how to set font styles in your page. We can
set the font face, font size and font color. Unfortunately, fonts depend
entirely on the user’s computer and browser. Setting fonts can become a
mess when you use fonts that are not common to other computers and
browsers. If the browser cannot display a specific font face and color, the
system will assume the default values.
HTML STYLE
HTML styles can be applied to any tag. You ca use font properties of the text by
applying the style attribute to the <p> tag. You can also apply the style to the body
of the document and table.
In using style, you just write the style after the tag and state the attributes
associated with the. The syntax of HTML styles is a little bit different from the
standard tag attribute. Suppose you want to specify the properties of text, say the
FONT face is ARIAL and the COLOR is RED you use the following code:
<p style=”font:Arial; color:RED; size:12px”>
</body>
</html>
Looking the code you maybe surprised that just displaying a few font effects,
you will need a very lengthy code. But do you really have to go to this
headache? No, you don’t have to. There is a much simpler and friendlier way to
do that, by using STYLE TAG.
STYLE TAG – the opening of the <style> tag and the </style> closing tag are
placed in the head of the document. STYLE RULES HAS TWO (2) PARTS:
SELECTOR - which indicates the element where the style applies to
</body>
</html>
What if you don’t want all your paragraphs to look the same? Suppose you have
three different paragraph styles to appear in a document.
CLASSES – are used to define different ways the same type of element displayed.
<html>
<head>
<style type="text/css">
p.par1
{
font-family: Calibri, Arial, sans-serif;
color:#990000;
text-align:center;
}
p.par2
{
font-family: Times New Roman, Arial, sans-serif;
color:#9370D8;
text-align:left;
}
p.par3
{
font-family: Courier New, Arial, sans-serif;
color:#FF69B4;
text-align:right;
}
</style>
</head>
<body>
<p class="par1"> First paragraph goes here</p>
<p class="par2"> Second paragraph goes here</p>
<p class="par3"> Third paragraph goes here</p>
</body>
</html>