- Cascading Style Sheets
Cascading Style Sheets (CSS) is a simple mechanism for adding style (e.g., fonts, colors, spacing) to Web documents. CSS can control the style and layout of multiple Web pages all at once.
- What is CSS?
- CSS stands for Cascading Style Sheets
- Styles define how to display HTML elements
- Styles were added to HTML 4.0 to solve a problem
- External Style Sheets can save a lot of work
- External Style Sheets are stored in CSS files
- Example(demo.css):
body
{
font-family:arial;
background-color:grey;
}
h1
{
font-size:28pt;
}
h2
{
color:blue;
}
p
{
margin-left:50px;
}
- Use of CSS:
<html> <head> <link rel="stylesheet" type="text/css" href="demo.css" /> </head> <body> <h1>This header is 28 pt</h1> <h2>This header is blue</h2> <p>This paragraph has a left margin of 50 pixels</p> </body> </html>



Posted in:
0 comments:
Post a Comment