×
Clear all filters including search bar
Valeri Tandilashvili's CSS Notes
border-bottom: 3px dashed orange;
The above style is a shorthand property of the following three properties:border-bottom-width: 20px;
border-bottom-style: dotted;
border-bottom-color: blue;
font: bold italic 14px Tahoma;
The above style is a shorthand property of the following four properties:
font-weight: bold;
font-style:italic;
font-size: 14px;
font-family: Tahoma;
.class1 .class2 h2{
color: red;
}
Selects all <h2>
elements within .class2
that is a descendant of .class1
elementp
element will be all uppercase and underlinedp {
text-decoration: underline;
text-transform: uppercase;
}
div.sticky {
background-color: yellow;
position: sticky;
top: 0;
}
A sticky element toggles between relative and fixed, depending on the scroll position. It is positioned relative until a given offset position is met in the viewport - then it "sticks" in place like position:fixed
p
elements that have div
element as a parent of any leveldiv p {
color: red;
}
Selects all the p
elements that are children of the element with id #id1
#id1 p {
color: green;
}
Selects all p
elements that have parent element with class .class1
.class1 p {
color: yellow;
}
letter-spacing
and word-spacing
properties to have some space between letters and wordsh1 {
letter-spacing: 2px;
word-spacing: 10px;
}
.logout
item will grow twice as quick as .home
item.home {
flex-grow: 1;
}
.logout{
flex-grow: 2;
}
p::first-letter {
color: blue;
font-size: 20px;
font-weight: bold;
background-color: yellow;
}
p::first-line {
color: blue;
font-size: 20px;
font-weight: bold;
background-color: yellow;
}