Shared Flashcard Set

Details

Top 12 CSS Selectors
Top 12 CSS Selectors
12
Computer Science
Beginner
12/24/2021

Additional Computer Science Flashcards

 


 

Cards

Term
Element or Group Selector
Definition

p {

  text-align: right;

  color: red;

}

 

Term
#id selector
Definition

#box{

width : 250px;

height: 250px;

}

Term
.class selector
Definition

.center{

text-align: center;

}

Term
Attribute selector
Definition

input[type="checkbox"] {

     color: purple;

}

Term
Descendant selector
Definition

div h2 {

 background-color: green;

}

Term
Child selector
Definition

div > h1 {

 background-color: green;

}

Term
Adjacent and general sibling selectors
Definition

div + p {

 background-color: red;

}

Term
The star selector *
Definition

* {

text-align: center;

color: red;

font-size: 30px;

}

 

OR

 

div * {

   background-color: red;

}

Term
Pseudo class
Definition

button:hover {

  color: blue;

}

Term
Pseudo-element
Definition

p::first-line {

  color: #ff0000;

  font-variant: small-caps;

}

Term
nth-of-type
Definition

li:nth-of-type(3) {

 color: red;

}

Term
nth-child
Definition

p:nth-child(3) {

 background: yellow;

}

Supporting users have an ad free experience!