Escolar Documentos
Profissional Documentos
Cultura Documentos
2
Introduction of CSS
CSS:-CSS stands for Cascading Style Sheets. Styles define how to display HTML
elements. Styles are normally stored in Style Sheets Styles were added to HTML 4.0 to
solve a problem (contents of HTML documents was clearly Separated from the
documents presentation layout).External Style Sheets can save you a lot of work.
External Style Sheets are stored in CSS files. Multiple style definitions will cascade into
one .CSS saves a lot of work. It can control the layout of multiple web pages all at once.
CSS Syntax:-The CSS syntax is made up of three parts: a selector, a property and a
value:
The selector is normally the HTML element/tag you wish to define, the property is the
attribute you wish to change, and each property can take a value. The property and value
are separated by colon, and surrounded by curly brace:
External Style Sheet: - An external style sheet is ideal when the style is applied to many
pages. With an external style sheet you can change the look of an entire web page by
changing one file. Each page must link to the style sheet using the <link> tag.
p{
margin-left:10px;
margin-right:20px;
padding:10px;
background-color"#ffcc99;
<html>
<head>
</head>
<body>
He made his One Day International (ODI) debut in December 2004 against
Bangladesh
</p>
</body>
</html>
Internal Style Sheet:- An internal style sheet should be used when a single document
has a unique style. Internal style can be defined in the head section of an HTML page
by using the <style> tag.
<html>
<head>
<style>
.a2
{
text-align: enter;
text-shadow: 1px 1px #000;
text-decoration: underline;
}
</style>
</head>
<body >
<table border="2" width="200px" height="250px">
Page 7
<tr><td>
<h1 class="a2">Welcome</h1>
<p class="a2"> You are very nice</p>
<h2 class="a2">God Bless You</h2>
</td>
</table>
</body>
</html>
Inline Style Sheet: - An inline style may be used to apply a unique style for a single
element. To use inline styles, add the style attribute to the relevant element. The style
attribute can contain any CSS property.
<html>
<head>
</head>
<body>
<table border="2" width="250px" height="150px">
<tr>
<td>
<h1 style="background-color:orange";
<h1><i>JAI HIND</h1>
<h2 style="background-color:green";
<h2><em>I LOVE MY INDIA </h1>
<h3 style="background-color:orange";
<h3><i>GOD BLESS TO MY INDIA</h1>
<h4 style="background-color:green";
<h4><em>God Bless You to all </h1></td></tr>
</table>
</body>
</html>
Page 8
Advantages of CSS
Page 9