-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathselectors
More file actions
43 lines (35 loc) · 1.06 KB
/
selectors
File metadata and controls
43 lines (35 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Here are some CSS selectors that I might forget in the future if I do not write them down...
/*Make only inputs with type 'text' have a gray background*/
input[type="text"] {
background: gray;
}
/* Give the 2nd <p> inside the 3rd <div> a 5px white border*/
div:nth-of-type(3) p:nth-of-type(2) {
border: 5px white solid;
}
/* Make the <em> in the 3rd <div> element white and 20px font(font-size:20px)*/
div:nth-of-type(3) em {
color: white;
font-size: 20px;
}
/*Make all "checked" checkboxes have a left margin of 50px(margin-left: 50px)*/
input[type="checkbox"]:checked {
margin-left: 50px;
}
/* Make the <label> elements all UPPERCASE without changing the HTML(definitely look this one up*/
label {
text-transform: uppercase;
}
/*Make the first letter of the element with id 'special' green and 100px font size(font-size: 100)*/
#special:first-letter {
color: green;
font-size: 100;
}
/*Make the <h1> element's color change to blue when hovered over */
h1:hover {
color: blue;
}
/*Make the <a> element's that have been visited gray */
a:visited {
color: gray;
}