How to Insert a Style Sheet

44 views

External 

With an external style sheet, you can change the look of an entire Web site by changing one file.This external style sheet must be save in the directory and ech page must link to the style sheet using the <link> tag. The <link> tag goes inside the head section:

<head>

<link rel=”stylesheet” type=”text/css”  href=”style.css” ></link>

</head>

body
{
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
color:#ECECEC;
background-repeat:repeat;
}
td
{
font-family:Arial, Helvetica,;
font-size:12px;
color:#000000;
}

a.link_blue

{

font-family:Arial,Helvetica;

font-size:10px;

color:#ECECEC;

}

a.link_red:hover

{

font-family:Arial;Times;

font-size:11px;

color:#ECECEC;

}

Internal Style Sheet

You can also define style sheet in same page  inside <head> by using <style> </style>tag.

[Example]

<head>

<link rel=”stylesheet” type=”text/css”  href=”style.css”></link>

<style>

body
{
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
color:#ECECEC;
background-repeat:repeat;
}
td
{
font-family:Arial, Helvetica,;
font-size:12px;
color:#000000;
}

</style>

</head>

Inline Style Sheet

Inline style sheets is a term that refers to style sheet information being applied to the current element. Instead of defining the style once, then applying the style against all instances of an element say the <P> tag . you apply the style to the instance you want the style to apply to. Actually it’s not really a style sheet as such, so a more accurate term would be inline styles.

<P style=”font-size: x-large; color: #ffffff”>
   Use this Style Sheet</p>

Multiple Style Sheet

If some properties have been set for the same selector in different style sheets, the values will be inherited from the more specific style sheet.

h3

{

color:red;

text-align: left;

font-size: 8pt;

}



« break And continue What is Java Script? »
Posted on Thursday, June 12th, 2008 at 8:29 pm under CSS For Beginners | RSS 2.0 Feed

Post Comment

You must be logged in to post a comment.



ComputerEducationWorld.com All Rights Reserved © RSS | CBSE | Education Boards Of India | What is My IP?