Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

CSS SELECTORS

Type selector
p {
}
Descendent selector: the CSS rule will only apply to li
tags that are children of ul tags.
ul li {
}
Pseudo-selector: a modifier that can be added to a
selector to select a tag only when a certain condition
has occurred.

a:hover {
text-decoration: underline;
}
The :first-child pseudo-selector will only select the
first child tag.
ol li:first-child {
color: red;
}
Attribute selector are a way to style a tag based on one
of its attributes.
input[type=submit] {
width: 120px;
font-size: 30px;
}
html, body, h1, h2, h3, p, ol, ul, li, a {
padding: 0;
border: 0;
margin: 0;
font-size: 100%
font: inherit;
}

You might also like