Complete CSS Detailed Notes
Complete CSS Detailed Notes
1. What is CSS?
CSS stands for Cascading Style Sheets. It is used to control the layout and presentation of HTML
elements.
Advantages:
2. Types of CSS
External Separate .css file Linked with <link> tag <link rel='stylesheet' href='style.css'>
3. CSS Syntax
selector {
property: value;
}
h1 {
color: green;
font-size: 30px;
}
4. CSS Selectors
The Box Model: Content -> Padding -> Border -> Margin
div {
margin: 10px;
padding: 20px;
border: 2px solid black;
CSS (Cascading Style Sheets) - Detailed Notes
<head>
<link rel='stylesheet' href='style.css'>
</head>
/* style.css */
body {
background-color: lightblue;
font-family: Verdana;
}
.highlight {
color: white;
background-color: green;
padding: 10px;
border-radius: 8px;
}
Result: A white text on green background with padding and rounded corners.