You are on page 1of 3

lecture 1 CSS.

a language used to describe the presentation od doc. written in html,


it is a simple way of adding spacing,styles in html doc. , there are
three ways in which we can add css in html doc. :-

selector{declaration;}

1. inline css:- used to add a unique style to a singke html element.

<p style....>

<html>

<head>

<p style="color:red; font size=10:">

<h1 style="....">

</body>

</html>

2. internal css:- it is used to add style to a single html document, it is


defined in head section of html page inside the style tag.

<html>

<head>

<style>

h1={color:green; font size=10;}


h2={color:red;}

</style>

</head>

<body>

<h1>good</h1>

<h2>morning</h2>

</body>

</html>

3. external css:-

it is used to make changes to multiple pages, in this the external style


sheet can be written in any text editor and be saved with .css
extension . the file need not contain html.....

<html>

<head>

<link rel="stylesheet" href= "abc.css">

</head>

<body>

<h1>good</h1>

<h2>morning</h2>

</body>
</html>

You might also like