Monday, August 27, 2012

Web Design-Lesson By Lesson


CSS Style Sheets
We can insert Styles into three locations.They are:
1.Inline Style Sheets
2.Embedded Style Sheets
3. External Style Sheets

Inline Style Sheets
   You can place a style tag direcly in a HTML tag.So we can called it as inline.
Example:-
<H1 STYLE = "Color:Blue">My Heading</H1>

Embedded Style Sheets
   We can place this in the HEAD section in our HTML page.When we embed a style in the HEAD section,
we have to use two tags to tell the browser where the style starts and ends.
Example:-
<HTML>
<HEAD>
<TITLE>CSS</TITLE>

<STYLE TYPE = "text/css">
</STYLE>

</HEAD>
<BODY>
You have to type your CSS rules between two STYLE tags.

External Style Sheets
 We can use seperate text file to type <STYLE> tags and the code for our all CSS rules instead of typing them in the HEAD section.
Example:-
<HEAD>
<TITLE>CSS</TITLE>

<LINK REL =Stylesheet TYPE="text/css" HREF="style.css">

</HEAD>
<BODY>
To embed a stylesheet the LINK tag is used. The REL attribute tells the browser that you want to link to
a stylesheet; the TYPE tells the browser what sort of file is being used; the HREF attribute tells the browser the name of the file, and where the file is.

External stylesheets are just text files, so you can write them in any text editor. Something like Windows Notepad is ideal.

When saving your external stylesheets, you don’t have to save it with the extension .css. You can save it with the extension .txt. In the HREF part of your LINK tag, you would then have this:

HREF = style1.txt

instead of

HREF = style1.css

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...