Adscend

Click Here



Click Here



Click Here

9.9.13

External Style Sheet

External Style Sheet

Suppose we have some web pages those are same looking. Situation comes that paragraphs, header, color etc. need to change. The simple way is to override the style.

1.Create a CSS file that contains all the styles. It is called external css file.

2.Map or link it with the html page.

3.In head portion, we will link to the external style sheet using the <link> tag.

4.<body>, <p>, <h1> and <style> etc tags are not use in External CSS. Instead body, p, h1 etc are used.

<head>
<link rel="stylesheet" type="text/css" href="mystyle.css"/>
</head>

The <link> tag defines the relationship between a document and an external resource.
The <link> tag is most used to link to style sheets.

Example
mystyle.css
body{background-color:#FFC}
h1{color:red}
p{margin-left:50px}

index.html
<html>
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css"/>
</head>
<body>
<h1>This is a heading.</h1>
<p>This is a paragraph.</p>
</body>
</html>

Output

This is a heading.

This is a paragraph.




No comments:

Post a Comment