0% found this document useful (0 votes)
42 views2 pages

Css Selectors: Type Selector

The document discusses different types of CSS selectors including type, descendent, pseudo, and attribute selectors and provides examples of each. It also includes a reset style to remove default browser styling.

Uploaded by

Tayyeba Shoaib
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views2 pages

Css Selectors: Type Selector

The document discusses different types of CSS selectors including type, descendent, pseudo, and attribute selectors and provides examples of each. It also includes a reset style to remove default browser styling.

Uploaded by

Tayyeba Shoaib
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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