Selector Based Style Sheet Language: Masud Rana
Selector Based Style Sheet Language: Masud Rana
The CSS starts in 1994. By Hakon Wium Lie. He was worked at CERN
Syntax
Selector {
Property : value;
ID = #
CLASS = .
Inline CSS
Internal CSS
External CSS
INLINE
Internal CSS
<style>
Selector {
Property : value;
}
</style>
Externat
.css
Ex: styele.css
COLOR
background Color :
3 way to use
Background-color: red;
Background-color: rgb(255,0,0);
Background-color: #c2c2c2
CSS Comments
/*
This is
a multi-line
comment
*/
➢ background-color
➢ background-image
➢ background-repeat
➢ background-attachment
➢ background-position
➢ Background-size
background Image
background Image
background: url(bitm.jpg);
background-size: Width Height;
ex: background-size: 100% 100%;
background-position: center top;
background-repeat: repeat / no-repeat / repeat-x / repeat-y;
Background-attachment: scroll / fixed ;
Border
border width :
border-top-width : 20px;
border-right-width : 15px;
border-bottom-width : 10px;
border-left-width : 5px;
Border
Border Color :
border-top-color : green;
border-right-color : red;
border-bottom-color : purple;
border-left-color : tomato;
Border
Border Style :
border-top-style : dotted;
border-right-style : solid;
border-bottom : dotted;
border-left-style : solid;
border-style
dotted/dashed/solid/double/groove/ridge/inset/outset/none/hidden;
Padding
padding-top : 20px;
padding-right : 15px;
padding-bottom :10px;
padding-left : 5px;
Margin
margin-top : 20px;
margin-right : 15px;
margin-bottom :10px;
margin-left : 5px;
Typography
Typography is the art and technique of arranging type to make
written language legible, readable and appealing when
displayed. The arrangement of type involves selecting typefaces,
point sizes, line lengths, line-spacing, and letterspacing, as well
as adjusting the space between pairs of letters.
Text-Decoration->
text-decoration: none | overline | line-through | underline;
Text Transformation->
text-transform: uppercase | lowercase | capitalize;
FONTS
font-size: medium|xx-small|x-small|small|large|xlarge|xx-
large|smaller|larger|length|initial|inherit;
font-style: normal|italic|oblique|initial|inherit;
font-weight: normal|bold|bolder|lighter|number|initial|inherit;
Font-family : arial;
FONTS
@font-face{
src: url(“URL/SOURCE”);
font-family: myFontName;
}
EX: use in p: p{
font-family: myFontName;
}
GOOGLE FONTS
Visite : fonts.google.com
Select a font
copy HTML link and paste inside head tag.
or copy CSS link and paste inside CSS file.
ICONS
1. Font Awesome Icons
2. Bootstrap Icons
3. Remix Icons
4. Flat Icon
Overflow
Overflow : visible / hidden / scroll / scroll ;
LIST
UL / OL -> LI :
DISPLAY
1. BLOCK ELEMENT.
2. INLINE ELEMENET.
Visibility
Opacity
z-index
Position
➢ Elements are then positioned using the top, bottom, left, and
right properties. However, these properties will not work unless
the position property is set first. They also work differently
depending on the position value
Position
1. Static
2. Relative
3. Fixed
4. Absolute
Position
Position: Static
Pseudo-classes
Pseudo-classes
Syntax :
selector:pseudo-class {
property: value;
}
P-classes : link | visited | hover | active | first-child | focus
Pseudo-Elements
Pseudo-Elements
Syntax :
selector::pseudo-elements {
property: value;
}
P-classes : first-line | first-letter | before | after | marker |
selection
Layout Module
➢ Flex (two-dimensional)
➢ Grid (multi-dimensional)
Layout Module
➢ Transitions
➢ Animations
Responsive-Layout
Media Queries
selectors{
property : value;
}
}