Professional Documents
Culture Documents
CSS:
stands for cascading style sheet
CSS Used to define styles and layouts of web pages writen with HTML and
XHTML
CSS simplifies the task of maintaining a web document by separating its style
information , such as font size , font color ,line width and background color ..
This separation allows you to apply same style rules multiple time in same web
page
CSS reduce complexity and redundancy of code in the web page and save time
HTML Syles :
the styles attribute in a new HTML attribute. It introduces CSS to HTML
With HTML styles , we can add styles to HTML elements directly by using the
style attribute , or indirectrly by separate it in style sheet (CSS)
Ex1:
<!DOCTYPE html>
<html>
<head>
<title>Example</title>
<style>
main {
width: 200px;
height: 200px;
padding: 10px;
background: beige;
}
h1 {
font-family: fantasy, cursive, serif;
color: olivedrab;
border-bottom: 1px dotted darkgreen;
}
p{
font-family: sans-serif;
color: orange;
}
</style>
</head>
<body>
<main>
<h1>HTML Page</h1>
<p>This is a basic web page.</p>
</main>
</body>
</html>
1
CSS syntax consist of :
Selector { property1:value1;
property2:value2 }