CSS Essential Training
CSS Essential Training
CHAPTER 1:
1.HTML and CSS -
HTML CSS
HTML is not used for presentation and CSS is used for presentation and
visualization. visualization.
HTML has comparatively less backup and CSS has comparatively higher backup
support. and support.
HTML doesn’t allow animations and CSS allows animation and transitions
transitions. which helps to improve the UI.
3. Referencing CSS :
There are 3 way Css can added to HTML. 1 )External,2)Internal,
3) Inline.
There are the 2 diff ways to Load External CSS file with a Link
tag or using the @import method.
# External Css with <link>
Always refernced within the <head> of the document
<head>
<link rel = “stylesheet” href = “css/style.css”>
</head>
# Inline Css :
#Internal CSS :
#Relative Path :
#Absolute Path :
CHAPTER 2
Css Syntanx :
A CSS rule consists of a selector and a declaration block.
CSS Syntax
The selector points to the HTML element you want to style.
Multiple CSS declarations are separated with semicolons, and declaration blocks
are surrounded by curly braces.
Example
In this example all <p> elements will be center-aligned, with a red text color:
p {
color: red;
text-align: center;
}
Example Explained
p is a selector in CSS (it points to the HTML element you want to style:
<p>).
color is a property, and red is the property value
text-align is a property, and center is the property value
Pseudo Classes :
HTML :
<a>no href</a>
<a href="#">link</a>
<a href="#">:visited</a>
<a href="#">:hover</a>
<a href="#">:active</a>
<a href="##">:focus</a>
CSS:
body {
font-size: 20px;
}
a{
/* color: red; */
}
a:link {
color: green;
}
a:visited {
color: gray;
}
a:focus {
/* outline: 1px solid black; */
}
a:hover {
background: gray;
}
a:active {
color: white;
}
CHAPTER 3 The Box Model
There are Five properties that make up the Box Model.
There are two type of HTML element : inline element and block
level.
https://codepen.io/christinatruong/pen/xxaYNLK