Showing posts with label HTML. Show all posts
Showing posts with label HTML. Show all posts

Saturday, March 13, 2010

How to auto redirect a page to another web page

Auto redirection is a technique to direct a visitor to another webpage after the visitor lands to a web page. The another webpage can be in the same website or to a different website. It can be within same page.

There are several methods by which we can achive auto-redirection.

1) The "Meta Refresh Tag" method:
It is believed that redirection using Meta Refresh Tag keeps the search engine happy as long as there is a reasonable delay between landing page and the page to which it is being redirected. In general at least 5 seconds is recommended. The Meta Refresh Code must be within <head> section.

The syntax for the "refresh" meta command is
<meta http-equiv="refresh" content="N; URL=other-web-address">

The "content" parameter contains two parts, seperated by a semi-colon.
The first part is the delay measured in seconds, before the redirection occurs.
And the second part is the URL to which it will redirect. Just like any hyperlink. It can be a relative URL or an absolute URL.
Note that for search engine optimization a delay of 0 (zero) seconds is not recommended.

Suppose if I want to redirect this page to http://arjudba.blogspot.com after 5 seconds then my meta tag refresh method will look like,
<meta http-equiv="refresh" content="5; URL=http://arjudba.blogspot.com">
2) The "Javascript" method:
A small JavaScript code can be used to use redirect to another page. This Javascript code can be placed to anywhere in the page but it is better to use it in head section so that it runs as soon as the page begins to load. A simple example is below.
<html>
<head>
<script language="javascript" type="text/javascript">
window.setTimeout('window.location="http://arjudba.blogspot.com/";',5000);
</script>
</head>
<body>
<a href="http://arjudba.blogspot.com">Arju</a>
</body>
</html>
With above Javascript After 5000 milliseconds (5 seconds) the page will be automatically redirected to http://arjudba.blogspot.com in the same window if JavaScript is enabled in the browser.

If we want new site will be displayed in a new window then JavaScript code will be,
<html>
<head>
<script language="javascript" type="text/javascript">
window.setTimeout('window.open("http://arjudba.blogspot.com/")',5000);
</script>
</head>
<body>
<a href="http://arjudba.blogspot.com">Arju</a>
</body>
</html>
We can also write JavaScript code and then may want to load it from a HTML section. For example following JavaScript code and then onLoad from <body> section will do the work.
<HTML>
<script>
function autoChange()
{
var timeID = setTimeout("location.href= 'http://arjudba.blogspot.com'", 5000)
}
</script>
<BODY onLoad="autoChange()">
Arju
</body>
</HTML>
Related Documents
http://arjudba.blogspot.com/2009/12/scrolling-text-effect-html-code-with.html
http://arjudba.blogspot.com/2009/12/open-link-in-new-window-or-in-new-tab.html
http://arjudba.blogspot.com/2009/09/html-special-character-reference.html
http://arjudba.blogspot.com/2009/07/css-margin-with-example.html

Tuesday, December 29, 2009

Scrolling text effect html code with MARQUEE

With MARQUEE we can add scrolling effect to text. Scrolling effect can be handy way to attract the users but too much using of it can spoil its purpose. Marquee can be used to add special announcement to a site, any special updates or advertisements. Before looking into MARQUEE example let's have a look at the list of attributes that it supports.

1)WIDTH: Tells how wide the marquee is. Can be set by pixel or percentage.

2)HEIGHT: Tells how tall the marquee is. Can be set by pixel or percentage.

3)DIRECTION: In which direction the marquee should scroll. Direction can have four values,

i)direction="left" - which is default.
Example:
<marquee direction="left" width="40%">Welcome to Arju's Blog</marquee>
effect is,





Welcome to Arju's Blog

ii)direction="right" - which indicates that the marquee starts at the left and moves rightwards across the page.
Example:
<marquee direction="right" width="40%">Welcome to Arju's Blog</marquee>
effect is,





Welcome to Arju's Blog

iii)direction="up" - scroll from down to up.
Example:
<marquee direction="up" width="40%">Welcome to Arju's Blog</marquee>
effect is,





Welcome to Arju's Blog

iv)direction="down" - scroll from up to down.
Example:
<marquee direction="down" width="40%">Welcome to Arju's Blog</marquee>
effect is,





Welcome to Arju's Blog

4)BEHAVIOR: How the contents will scroll.
i)BEHAVIOR=SCROLL - which is default, content scroll off the edge of the marquee area, then reappear on the other side.

ii)BEHAVIOR=SLIDE - It indicates that when the leading part content reaches the edge it should stop without scrolling off.
Example:
<marquee direction="left" behavior="slide" width="40%">Welcome to Arju's Blog</marquee>
effect is,





Welcome to Arju's Blog

BEHAVIOR=ALTERNATE - It makes the content bounce back and forth, all of it remaining visible all the time.
Example:
<marquee direction="left" behavior="alternate" width="40%">Welcome to Arju's Blog</marquee>
effect is,





Welcome to Arju's Blog

5)SCROLLDELAY: It sets the speed of scrolling. It sets amount of delay in milliseconds. By default it's value is 85 which means it displays the content, then delays 85 milliseconds and then displaying the content again in a new position.
If we want scrolling speed half a second then set SCROLLDELAY=500.
Example:
<marquee direction="left" SCROLLDELAY=500 width="40%">Welcome to Arju's Blog</marquee>
effect is,





Welcome to Arju's Blog

If we want scrolling speed one second then set SCROLLDELAY=1000
Example:
<marquee direction="left" SCROLLDELAY=1000 width="40%">Welcome to Arju's Blog</marquee>
effect is,





Welcome to Arju's Blog

6)SCROLLAMOUNT: It sets the speed of scrolling by setting how far to jump in pixels. A higher value for SCROLLAMOUNT makes the marquee scroll faster. The default value is 6.
An example by making the SCROLLAMOUNT to 18.
Example:
<marquee direction="left" SCROLLAMOUNT =18 width="40%">Welcome to Arju's Blog</marquee>
effect is,





Welcome to Arju's Blog

Example by making the SCROLLAMOUNT to 30.
Example:
<marquee direction="left" SCROLLAMOUNT =30 width="40%">Welcome to Arju's Blog</marquee>
effect is,





Welcome to Arju's Blog

7)LOOP: LOOP sets how many times the marquee should loop. It can have two types of value.
i)INFINITE ii)integer value in terms of number of loops.
By default, LOOP is INFINITE, which means that the marquee loops endlessly.
Following code will LOOP 3 times and then it stops.
Example:
<marquee direction="left" LOOP=3 width="40%">Welcome to Arju's Blog</marquee>
effect is,





Welcome to Arju's Blog

Note that, if we use only LOOP attribute then content disappears after the last loop. If we want that the content will be visible after the looping is finished then we have to add BEHAVIOR SLIDE attribute like below.
Example:
<marquee direction="left" LOOP=3 behavior="slide" width="40%">Welcome to Arju's Blog</marquee>
effect is,





Welcome to Arju's Blog

8)BGCOLOR: It sets the background color of the MARQUEE.
Example:
<marquee direction="down" bgcolor=pink width="40%">Welcome to Arju's Blog</marquee>
effect is,





Welcome to Arju's Blog

9)HSPACE: HSPACE sets the horizontal space to the left and right of the marquee.
Following example shows the HSPACE by setting 30 and 50.

<MARQUEE HSPACE=30 WIDTH="40%" BGCOLOR=GREEN>
Welcome to <p> my blog
</MARQUEE>Next after HSPACE!

<MARQUEE HSPACE=50 WIDTH="40%" BGCOLOR=GREEN>
Welcome to <p> my blog
</MARQUEE>Next after HSPACE!
which looks like,







Welcome to
my blog


Next after HSPACE!







Welcome to
my blog


Next after HSPACE!

10)VSPACE: VSPACE sets the vertical space at the top and bottom of the marquee.
Following example demonstrate VSPACE by setting it 30 and 50.
Hi,
<MARQUEE VSPACE=30 WIDTH="40%" BGCOLOR=GREEN>
Welcome to my blog
</MARQUEE>Next after VSPACE!

Hi,
<MARQUEE VSPACE=50 WIDTH="40%" BGCOLOR=GREEN>
Welcome to my blog
</MARQUEE>Next after VSPACE!

which will look like,

Hi,






Welcome to my blog
Next after VSPACE!

Hi,






Welcome to my blog
Next after VSPACE!

The basic use of <MARQUEE ..> is simple. Put text between <MARQUEE ...> and </MARQUEE>.<MARQUEE ...> is a text level element. By default <MARQUEE ...> has a WIDTH of 100%, so it might appear as a block level. However, if you set the width to something smaller than 100%, you might notice that the marquee is in line with the surrounding text.
Related Documents
http://arjudba.blogspot.com/2009/08/how-to-increase-your-technorati.html

http://arjudba.blogspot.com/2009/07/how-to-setup-google-webmaster-tool-for.html
http://arjudba.blogspot.com/2009/06/how-to-get-targeted-backlinks-to-your.html
http://arjudba.blogspot.com/2009/07/draw-google-adsense-money-using-western.html
http://arjudba.blogspot.com/2009/06/different-types-of-web-hosting-services.html
http://arjudba.blogspot.com/2009/07/how-to-add-site-to-yahoo-directory.html
http://arjudba.blogspot.com/2009/07/how-to-add-site-to-google-directory.html
http://arjudba.blogspot.com/2009/12/how-to-know-when-googlebot-last-crawled.html
http://arjudba.blogspot.com/2009/12/how-to-add-different-meta-tags-to.html
http://arjudba.blogspot.com/2009/12/how-to-disable-or-remove-blogger.html

Monday, December 28, 2009

Open a link in a new window or in a new tab using HTML Target

The <a> tag defines an anchor. An anchor is used in a HTML document in order to create a link to another document, by using the href attribute.

Note that by default anchor tag shows following behaviour,
- An unvisited link is underlined and blue
- A visited link is underlined and purple
- An active link is underlined and red.

Following is an example of an anchor link.
<a> href=
http://arjudba.blogspot.com/2009/11/affordable-search-engine-optimization.html>SEO packages
</a>
which will look like,
SEO packages

The named anchor itself doesn't have a hash mark. If you want to point to a certain part of a webpage you have to specify id of that document and then link to the named anchor with a hash mark. For example if we want to point to platinum package in the same post then we have to specify as,
<a> href=
http://arjudba.blogspot.com/2009/11/affordable-search-engine-optimization.html#platinum>Platinum Package
</a>
which will look like,
Platinum Package

If you left click on these two hyper link you will see that both links are opened in the same window. But after clicking the link sometimes it may be useful to open window in a new window or in a new tab so that user don't leave the current window. We can achieve this by using TARGET.

Clicking on a link simply loads a new document in the same window where the link was. The TARGET keyword of anchor controls where the new document will be displayed when the user follows a link. With TARGET keyword, you can have the new document open in a new window, or if you are using frames, in another frame.

TARGET can have four predefined values.
1) "_blank"
2) "_parent"
3) "_self"
4) "_top"
Note that each value start with an underscore and are lowercase.

1)TARGET = "_blank": If you use TARGET="_blank" with the anchor tag then the new document opens in a new window while leaving the main window. Following is an example,
<a> href=
http://arjudba.blogspot.com/2009/11/affordable-search-engine-optimization.html#platinum TARGET="_blank">Platinum Package
</a>
which behaves as,
Platinum Package

2)TARGET = "_parent": "_parent" is used in the situation where a frameset is nested inside another frameset. In that case you have both parent frameset and child frameset existed. By using TARGET=_parent causes a link in one of the child frameset documents uses "_parent" to load the new document.
If the current document's frameset file does not have any "parent", then "_parent" works exactly like "_top": the new document is loaded in the full window.

3)TARGET = "_self": TARGET="_self" puts the new document in the same window and frame as the current document. "_self" works the same as if you had not used TARGET at all.

4)TARGET = "_top": TARGET = "_top" loads the linked document in the topmost frame which means, the new page fills the entire window.

Another use of TARGET is TARGET = window name by which window name is used to put the linked document in a frame or window other than the frame the link is in.

Related Documents

Monday, September 7, 2009

HTML special character reference

Sometimes you face problems while entering symbols in you HTML browser. For example you entered © symbol in your browser but it displayed as ? in the browser. The reason is you may not be able to enter certain symbols or characters into your web page using a single key or character.

To enter such a special characters or symbols you need to use 4 characters using the associated "numeric character reference" code or the "character entity reference" code.

However you browser may not support all the character reference.

Numeric character reference : It is the numeric representation of a given character. To use the numeric character reference in your HTML code, use the following format:
&#Numeric character reference;

For example, to display the © symbol using the numeric character reference, enter:

©

Character entity reference : It is the standard name of a given character. To use the character entity reference in your HTML code, use the following format instead:
&Character entity reference;

For example, to display the © symbol using the character entity reference:

©

Following lists contain both Character entity reference as well as Numeric character reference :













































































































































































































































































































































































































































































































































































































































































































Punctuation HTML Entity
(case sensitive)
ISO Latin-1 code name or meaning
&ensp; &#8194;
en space
&emsp; &#8195;
em space
&sbquo; &#8218;
single low-9 quotation mark
&bdquo; &#8222;
double low-9 quotation mark
&dagger; &#8224;
dagger
&Dagger; &#8225;
double dagger
&permil; &#8240;
per mille sign
&bull; &#8226;
bullet = black small circle
&hellip; &#8230;
horizontal ellipsis = three dot leader
&prime; &#8242;
prime = minutes = feet
&ndash; &#8211;
en dash
&mdash; &#8212;
em dash
¡ &iexcl; &#161; inverted exclamation
¿ &iquest; &#191; inverted question mark
" &quot; &#34; quotation mark
&ldquo; &#8220; left double curly quote
&rdquo; &#8221; right double curly quote
&lsquo; &#8216; left single curly quote
&rsquo; &#8217; right single curly quote
«
»
&laquo;

&raquo;
&#171;

&#187;
guillemets (European-style quotation marks)

(Its
there, but you can't see it!)
&nbsp; &#160; non-breaking space
Symbols
& &amp; &#38; ampersand
¢ &cent; &#162; cent
© &copy; &#169; copyright
× &times; &#215; multiplication
÷ &divide; &#247; divide
> &gt; &#62; greater than
< &lt; &#60; less than
µ &micro; &#181; micron
· &middot; &#183; middle dot
&para; &#182; pilcrow (paragraph sign)
± &plusmn; &#177; plus/minus
&euro; &#8364; Euro
£ &pound; &#163; British Pound Sterling
® &reg; &#174; registered
§ &sect; &#167; section
&trade; &#153; trademark
¤ &curren; &#164; currency
¥ &yen; &#165; Japanese Yen
¦ &brvbar; &#166; broken vertical bar
¨ &uml; &#168; spacing diaeresis
ª &ordf; &#170; feminine ordinal indicator
¬ &not; &#172; negation
­ &shy; &#173; soft hyphen
¯ &macr; &#175; spacing macron
° &deg; &#176; degree
² &sup2; &#178; superscript 2
³ &sup3; &#179; superscript 3
¸ &cedil; &#184; spacing cedilla
¹ &sup1; &#185; superscript 1
º &ordm; &#186; masculine ordinal indicator
¼ &frac14; &#188; fraction 1/4
½ &frac12; &#189; fraction 1/2
¾ &frac34; &#190; fraction 3/4
Diacritics
á

Á
&aacute;

&Aacute;
&#225;

&#193;
lower-case "a" with acute accent


upper-case "A" with acute accent
à

À
&agrave;

&Agrave;
&#224;

&#192;
lower-case "a" with grave accent


upper-case "A" with grave accent
â

Â
&acirc;

&Acirc;
&#226;

&#194;
lower-case "a" with circumflex


upper-case "A" with circumflex
å

Å
&aring;

&Aring;
&#229;

&#197;
lower-case "a" with ring


upper-case "A" with ring
ã

Ã
&atilde;

&Atilde;
&#227;

&#195;
lower-case "a" with tilde


upper-case "A" with tilde
ä
Ä
&auml;

&Auml;
&#228;

&#196;
lower-case "a" with diaeresis/umlaut


upper-case "A" with diaeresis/umlaut
æ

Æ
&aelig;

&AElig;
&#230;

&#198;
lower-case "ae" ligature


upper-case "AE" ligature
ç

Ç
&ccedil;

&Ccedil;
&#231;

&#199;
lower-case "c" with cedilla


upper-case "C" with cedilla
é

É
&eacute;

&Eacute;
&#233;

&#201;
lower-case "e" with acute accent


upper-case "E" with acute accent
è

È
&egrave;

&Egrave;
&#232;

&#200;
lower-case "e" with grave accent


upper-case "E" with grave accent
ê

Ê
&ecirc;

&Ecirc;
&#234;

&#202;
lower-case "e" with circumflex


upper-case "E" with circumflex
ë
Ë
&euml;

&Euml;
&#235;

&#203;
lower-case "e" with diaeresis/umlaut


upper-case "E" with diaeresis/umlaut
í

Í
&iacute;

&Iacute;
&#237;

&#205;
lower-case "i" with acute accent


upper-case "I" with acute accent
ì

Ì
&igrave;

&Igrave;
&#236;

&#204;
lower-case "i" with grave accent


upper-case "I" with grave accent
î

Î
&icirc;

&Icirc;
&#238;

&#206;
lower-case "i" with circumflex


upper-case "I" with circumflex
ï
Ï
&iuml;

&Iuml;
&#239;

&#207;
lower-case "i" with diaeresis/umlaut


upper-case "I" with diaeresis/umlaut
ñ

Ñ
&ntilde;

&Ntilde;
&#241;

&#209;
lower-case "n" with tilde


upper-case "N" with tilde
ó

Ó
&oacute;

&Oacute;
&#243;

&#211;
lower-case "o" with acute accent


upper-case "O" with acute accent
ò

Ò
&ograve;

&Ograve;
&#242;

&#210;
lower-case "o" with grave accent


upper-case "O" with grave accent
ô

Ô
&ocirc;

&Ocirc;
&#244;

&#212;
lower-case "o" with circumflex


upper-case "O" with circumflex
ø

Ø
&oslash;

&Oslash;
&#248;

&#216;
lower-case "o" with slash


upper-case "O" with slash
õ

Õ
&otilde;

&Otilde;
&#245;

&#213;
lower-case "o" with tilde


upper-case "O" with tilde
ö
Ö
&ouml;

&Ouml;
&#246;

&#214;
lower-case "o" with diaeresis/umlaut


upper-case "O" with diaeresis/umlaut
ß &szlig; &#223; ess-tsett
ú

Ú
&uacute;

&Uacute;
&#250;

&#218;
lower-case "u" with acute accent


upper-case "U" with acute accent
ù

Ù
&ugrave;

&Ugrave;
&#249;

&#217;
lower-case "u" with grave accent


upper-case "U" with grave accent
û

Û
&ucirc;

&Ucirc;
&#251;

&#219;
lower-case "u" with circumflex


upper-case "U" with circumflex
ü
Ü
&uuml;

&Uuml;
&#252;

&#220;
lower-case "u" with diaeresis/umlaut


upper-case "U" with diaeresis/umlaut
ÿ &yuml; &#255; lower-case "y" with diaeresis/umlaut
´
`
&#180;

&#96;
acute accent with no letter


grave accent/reversed apostrophe with no letter
Letter like Symbols
&weierp; &#8472; script capital P = power set = Weierstrass p
&image; &#8465; blackletter capital I = imaginary part
&real; &#8476; blackletter capital R = real part symbol
Mathematical Operators
&empty; &#8709; empty set = null set = diameter
&sum; &#8721; sum sign
&minus; &#8722; minus sign
&lowast; &#8727; asterisk operator
&radic; &#8730; square root
&infin; &#8734; infinity
&cap; &#8745; intersection = cap
&sim; &#8764; tilde operator
&asymp; &#8776; almost equal to = asymptotic to
&equiv; &#8801; identical to
&le; &#8804; less-than or equal to
&ge; &#8805; greater-than or equal to




Relared Documents

Friday, July 17, 2009

CSS margin with example.

To understand margin let's start a general example and see how it display in the browser. Copy the following code and see from browser,

<html>
<body>
In this blog http://arjudba.blogspot.com you will
see there is some space (though a very little amount)
all around. But there is no space whenever you
will disply this html code inside your browser.
<blockquote>

But there will be some spaces all around this
blockquote. Both left, right, top, bottom side.

</blockquote>
You are recommended to join http://arju-on-it.com/forum
and discuss your problems there
</body>
</html>


If you run above html code, you will see all around of blockquote text there is space. But don't have control how much space will be all around. In CSS, this space is called "margins" and margins are controlled by four properties, margin-left, margin-right, margin-top and margin-bottom. We can minimize space around blockquote by following css code,

blockquote {
margin-top: 1em;
margin-right: 0em;
margin-bottom: 1em;
margin-left: 0em;
}

We can shorthand margin property by setting all margin properties using,

blockquote{
margin: 1em 0em 1em 0em;
}

The first part 1em is for margin-top and then it goes clockwise, second part is margin-right, then margin-bottom and then margin-left.

Let's assign some background colour all around blockquote. We can do this simply by background. Like,

blockquote{
margin: 1em 0em 1em 0em;
background: #AAA;
}

We will see that the background color barely covers the quoted text. But the margin area is not affected. However if we want that background color will be there will some amount of space around quote text(element) then we have to use another property of CSS called padding.

With usage of padding css code will look like,

blockquote{
margin: 1em 0em 1em 0em;
background: #AAA;
padding:.5em .5em .5em .5em;
}

Similar to margin padding can be padding-top, padding-right, padding-bottom, padding-left.

So, our final code will look like,

<html>
<style type="text/css">
blockquote{
margin: 1em 0em 1em 0em;
background: #AAA;
padding:.5em .5em .5em .5em;
}
</style>
<body>
In this blog http://arjudba.blogspot.com you will
see there is some space (though a very little amount)
all around. But there is no space whenever you
will disply this html code inside your browser.
<blockquote>
But there will be some spaces all around this
blockquote. Both left, right, top, bottom side.
</blockquote>
You are recommended to join http://arju-on-it.com/forum
and discuss your problems there
</body>
</html>

Final output is in,




Monday, July 13, 2009

CSS Tutorial- Starting with CSS, how to use and integrate it.

CSS stands for Cascading Style Sheets. CSS is the very simple mechanism for adding style (this is fonts, colors, spacing) to Web pages. This post is about how to use css into an html documents and how these two can be work together. Step by step it is discussed of using css into html documents.

Step 1: Create a Html file.
Simply you can use notepad on windows or vi on unix to write a simple html file. You can use third party open source program like notepad++. But never use wordprocessor, such as Microsoft Word or OpenOffice. Because their outcome comes in different format and browser can't read it.

Note that in html comment starts with <!-- and ends with -->
My content of index.html is below.

<html>
<head>
<title>My first styled page</title>
</head>

<body>

<!-- Site navigation menu -->
<ul class="navigation_bar">
<li><a href="index.html">Home page</a>
<li><a href="products.html">Our Products</a>
<li><a href="contact_us.html">Contact us</a>
<li><a href="about_us.html">About us</a>
</ul>

<!-- Main content -->
<h1>This topic is one is for learning css</h1>

<p>Welcome to http://arjudba.blogspot.com

<p>It is just an example.
You can enhance it as you go on.
The style does not look so good.

<p>More learning materials
are coming soon.

<!-- Just publishing today's date with signature -->
<address>14th July, 2009.<br>
by Mohammad Abdul Momin Arju.</address>

</body>
</html>

In the example the tag <ul> introduces an "Unordered List", which means a list in which the items are not numbered. The <li> is the start of a "List Item." Note that <ul>, <p> does not need closing tags.

Step 2: Add some colours:
If you run codes of step1 you will see black text within white background. So with css we want to add some colours to background as well as to text. For css style we should make another file named style.css so that we can use that style for another html file. But in this post to make it easier, I am placing css styles in the same html file index.html. To do it we need to add a <style> element to the HTML file.

Let's see my style looks like,

<html>
<head>
<title>My first styled page</title>
<style type="text/css">
body {
color: green;
background-color: #ededed
}
</style>
</head>

<body>
etc...

Note that in case of adding css element there is followed by rules and each rule contains three part..

selector{
property:value;
}

1. The selector (in the example: "body"), which tells the browser which section of the web page will be affected by css style.

2. The property (in the example, 'color' and 'background-color' are both properties), which tells the browser what aspect of the layout is being set.

3. And the third one is value (in the example 'green' and '#ededed'), which gives the value for the style property.

Step 3: Add fonts
For good design and good look and feel you can add different fonts to different section of the page. For body Georgia font is used, if it is not available, Times New Roman or Times will be there, and if all else fails, the browser may use any other font with serifs.

For heading section Helvetica will be used. If not available Arial will be there, if both unavailable any fonts with sans-serif.

<html>
<head>
<title>My first styled page</title>
<style type="text/css">
body {
font-family: Georgia, "Times New Roman",
Times, serif;
color: purple;
background-color: #d8da3d }
h1 {
font-family: Helvetica, Arial, sans-serif }

</style>
</head>

Step 4: Add a navigation bar
We already have navigation menu at top of the page. But we want to move menu bar on left. This is done by css position property with a value of absolute. Also we need to position of body to the right so that menu and body does not overlap. We can move the body to the right by using padding-left property. So our css code now stands,

<html>
<head>
<title>My first styled page</title>
<style type="text/css">
body {
padding-left:14em;
font-family: Georgia, "Times New Roman",
Times, serif;
color: purple;
background-color: #d8da3d }
h1 {
font-family: Helvetica, Arial, sans-serif }
ul.navigation_bar{
position: absolute;
top: 2em;
left: 1em;
width: 9em }

</style>
</head>
<body>

Here measure 2em means 2 times the size of the current font. E.g., if the menu is displayed with a font of 14 points, then '2em' is 24 points. The 'em' is a very useful unit in CSS, since it can adapt automatically to the font that the reader happens to use.

Step 5: Style the links
Still now navigation menu looks like list. Using list-style-type property we will remove bullet. And we will make background as green of all menu items so that it looks like menu. To make each menu separate margin property would have a value. Also we will change the colours of the links. If user has not visited yet then make it blue and if user has visited link then we will make it purple.

Now it looks,

<html>
<head>
<title>My first styled page</title>
<style type="text/css">
body {
padding-left:14em;
font-family: Georgia, "Times New Roman",
Times, serif;
color: purple;
background-color: #d8da3d }
h1 {
font-family: Helvetica, Arial, sans-serif }
ul.navigation_bar{
list-style-type: none;
position: absolute;
top: 2em;
left: 1em;
width: 9em }
li{
background:green;
border:0;
padding:.5em;
margin:.3em;
}
a {
text-decoration: none }
a:link {
color: blue }
a:visited {
color: purple }

</style>
</head>

Step 6: Add a horizontal line
To make separate address from main page I am adding a horizontal line after body.
So just adding this line within style sheet.

address {
margin-top: 1em;
padding-top: 1em;
border-top: thin dotted }

Step 7: Put the style sheet in a separate file.
Now we are separating the syle sheet in another file so that we can use this style in many other web pages. Let's name this as style.css which looks like,

body {
padding-left:14em;
font-family: Georgia, "Times New Roman",
Times, serif;
color: purple;
background-color: #d8da3d }
h1 {
font-family: Helvetica, Arial, sans-serif }
ul.navigation_bar{
list-style-type: none;
position: absolute;
top: 2em;
left: 1em;
width: 9em }
li{
background:green;
border:0;
padding:.5em;
margin:.3em;
}
a {
text-decoration: none }
a:link {
color: blue }
a:visited {
color: purple }
address {
margin-top: 1em;
padding-top: 1em;
border-top: thin dotted }

Now from html file index.html reference it as,
<link rel="stylesheet" href="mystyle.css">
Our index.html looks like,

<html>
<head>
<title>My first styled page</title>
<link rel="stylesheet" href="style.css">

</style>
</head>


<body>

<!-- Site navigation menu -->
<ul class="navigation_bar">
<li><a href="index.html">Home page</a>
<li><a href="products.html">Our Products</a>
<li><a href="contact_us.html">Contact us</a>
<li><a href="about_us.html">About us</a>
</ul>

<!-- Main content -->
<h1>This topic is one is for learning css</h1>

<p>Welcome to http://arjudba.blogspot.com

<p>It is just an example.
You can enhance it as you go on.
The style does not look so good.

<p>More learning materials
are coming soon.

<!-- Just publishing today's date with signature -->
<address>14th July, 2009.<br>
by Mohammad Abdul Momin Arju.</address>

</body>
</html>

The output will be,