-
Notifications
You must be signed in to change notification settings - Fork 0
/
styles.css
82 lines (52 loc) · 2.29 KB
/
styles.css
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*Assignment 1: Basic Syntax
(1) To create a CSS file named "styles.css" and link it to an HTML file, you can use the following code in the head section of your HTML document:
*/
/*(2)To change the background color of the body element to blue, you can use the following CSS rule in your "styles.css" file:*/
body {
background-color: blue;
}
/*(3)To change the font family of all headings to "Arial", you can use the following CSS rule:*/
h1, h2, h3, h4, h5, h6 {
font-family: Arial;
}
/*(4)To make the text of all p elements bold, you can use the following CSS rule:*/
p {
font-weight: bold;
}
/* Assignment 2: CSS Selectors */
/* To change the color of all headings to red, you can use the following CSS rule: */
h1, h2, h3, h4, h5, h6 {
color: red;
}
/* To change the color of all paragraphs to green, you can use the following CSS rule: */
p {
color: green;
}
/* To change the font size of all paragraphs with class "important" to 18px, you can use the following CSS rule: */
p.important {
font-size: 18px;
}
/* To change the font weight of the paragraph with id "intro" to bold, you can use the following CSS rule: */
#intro {
font-weight: bold;
}
/* Assignment 3: Grouping Selectors */
/* To change the font family of all headings and paragraphs to "Georgia", you can use the following CSS rule: */
h1, h2, h3, h4, h5, h6, p {
font-family: Georgia;
}
ul, ol {
border: 1px solid;
}
/* Assignment 4: Combining Multiple Selectors */
/* Create an HTML page with different elements such as headings, paragraphs, and images. */
/* To change the font family of all headings and paragraphs inside a div with class "container", you can add the following code in your "styles.css" file: */
.container h1, .container h2, .container h3, .container h4, .container h5, .container h6, .container p {
font-family: Georgia;
}
/* To change the font size of all headings inside a div with class "container" and id "header" to 28px, you can add the following code in your "styles.css" file:
less
*/
.container #header h1, .container #header h2, .container #header h3, .container #header h4, .container #header h5, .container #header h6 {
font-size: 28px;
}