-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcss_styling_2.html
More file actions
207 lines (201 loc) · 8.85 KB
/
css_styling_2.html
File metadata and controls
207 lines (201 loc) · 8.85 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
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible", content="IE-edge">
<title>Styling Lists | Vijay CSS</title>
<link rel="stylesheet", href="css/style.css">
<link rel="stylesheet", href="css/fonts.css">
<link rel="stylesheet", href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css"> <!--Import more fonts from font-awesome-->
<style>
/* General */
h1 {font-size: 40px; text-align: center; color: rgb(0, 112, 0); text-shadow: 10px 10px 10px rgb(53, 189, 0);}
h2 {font-size: 30px; color: rgb(255, 174, 0); text-shadow: 10px 10px 10px rgb(0, 255, 255);}
ul, ol {font-size: 20px; font-family: inherit; padding-left: 1em;}
p {font-size: 20px; font-family: inherit;}
/* Structure */
body
{
background-color: #c2f8fa;
font-family: Arial;
}
header
{
background-color: gold;
border: 5px solid black;
outline: 5px outset rgb(53, 168, 0);
outline-offset: 2em;
border-radius: 20px;
margin: 4em 4em 6em 4em;
padding: 2em;
width: 80%;
}
section
{
border: 5px solid black;
border-radius: 20px;
outline: 10px solid rgb(168, 168, 168);
margin: 4em;
padding: 2em;
width: 80%;
}
div
{
border: 5px dashed white;
border-radius: 20px;
line-height: 1.5;
margin: 4em;
padding: 2em;
width: 80%;
}
/* Individual lists */
#section1
{
ul li a {color: rgb(11, 123, 197); text-decoration: none;}
ul li a:hover {color: blue; opacity: 0.9; text-decoration: underline;}
ul li a:focus {background-color: rgb(255, 153, 0); color: blue; text-decoration: underline;}
ul li a:active {color: red; opacity: 1.0;}
}
#section2
{
ol li a {color: blue; text-decoration: none;}
ol li a:hover {color: rgb(200, 255, 0); opacity: 0.5; text-decoration: line-through;}
ol li a:focus {background-color: rgb(255, 153, 0); color: rgb(102, 155, 180); text-decoration: underline;}
ol li a:active {color: red; opacity: 1.0;}
}
#section3
{
ol li:nth-child(even) {color: green;}
ol li:nth-child(odd) {color: yellow;}
}
#section4
{
ol li:nth-child(3) {font-style: italic;}
ol li:nth-child(4) {text-decoration: overline;}
}
/* Unordered list styles */
ul.none {list-style-type: none;}
ul.disc {list-style-type: disc;}
ul.circle {list-style-type: circle;}
ul.square {list-style-type: square; color:}
/* Ordered list styles */
ol.none {list-style-type: none;}
ol.decimal {list-style-type: decimal;}
ol.lower-alpha {list-style-type: lower-alpha;}
ol.lower-roman {list-style-type: lower-roman;}
ol.upper-alpha {list-style-type: upper-alpha;}
ol.upper-roman {list-style-type: upper-roman;}
/* Text formatting */
span.underline {text-decoration: underline;}
span.strikethrough {text-decoration: line-through;}
span.overline {text-decoration: overline;}
span.italic {font-style: italic;}
span.oblique {font-style: oblique;}
span.bold {font-weight: 700;}
span.bold-plus {font-weight: 1000;}
span.highlight {background-color: gold;}
/* Background colours */
.bg-red {background-color: rgb(255, 115, 115);}
.bg-blue {background-color: rgb(158, 158, 255);}
.bg-green {background-color: rgb(144, 247, 144);}
.bg-yellow {background-color: rgb(255, 255, 0);}
.bg-pink {background-color: rgb(255, 126, 147);}
.bg-orange {background-color: rgb(245, 190, 89);}
.bg-purple {background-color: rgb(195, 44, 255);}
.bg-brown {background-color: rgb(168, 81, 0);}
</style>
</head>
<body>
<header>
<h1>CSS Styling</h1>
</header>
<main>
<section class="bg-purple", id="section1">
<h2>Overview</h2>
<div class="bg-pink">
<p>
Below are a list of CSS links. For the unordered list below, opacity of 0.9 has been applied to the hyperlinks.
Opacity will adjust the level of transparency when the links have been hovered over. CSS opacity values between
0.0 (invisible) - 1.0 (solid).
</p>
</div>
<div class="bg-orange">
<ul class="square">
<li><a href="#">Unordered List 1</a></li>
<li><a href="#">Unordered List 2</a></li>
<li><a href="#">Unordered List 3</a></li>
<li><a href="#">Unordered List 4</a></li>
<li><a href="#">Unordered List 5</a></li>
</ul>
</div>
</section>
<section class="bg-green", id="section2">
<h2>Ordered List</h2>
<div class="bg-blue">
<p>
This is <span class="highlight">section 2</span> of the CSS styling page. This section will be covering an
ordered list (ol) instead of unordered list (ul) and applying a range of listing and hyperlink styles.
</p>
</div>
<div class="bg-blue">
<p><span class="bold">
The below is a decimal (default) ordered list, but starting from 5.
</span></p>
<ol start="5">
<li><a href="#">Ordered List 1</a></li>
<li><a href="#">Ordered List 2</a></li>
<li><a href="#">Ordered List 3</a></li>
<li><a href="#">Ordered List 4</a></li>
<li><a href="#">Ordered List 5</a></li>
</ol>
</div>
</section>
<section class="bg-brown", id="section3">
<h2>Custom Ordered List</h2>
<div class="bg-yellow">
<p>
This is section 3 of the CSS styling page. This section will be using ordered lists and applying more custom
styles to each listed item.
</p>
</div>
<div class="bg-purple">
<p>
The below is an ordered list using roman numerals and nth-child properties (green for even; yellow for odd).
</p>
<ol class="upper-roman">
<li>Listed Item 1</li>
<li>Listed Item 2</li>
<li>Listed Item 3</li>
<li>Listed Item 4</li>
<li>Listed Item 5</li>
</ol>
</div>
</section>
<section class="bg-pink", id="section4">
<h2>Reversed Ordered List</h2>
<div class="bg-blue">
<p>
This is <span class="bold-plus">section 4</span> of the CSS styling page. This section will be using an ordered list and applying a reversed
style to it.
</p>
</div>
<div class="bg-orange">
<p>
The below is a reversed ordered list using text colour green and the list style: upper alpha. Nth-child pseudo-classes
have been applied on listed items 3 and 4 to make them italic and overlined.
</p>
<ol class="upper-alpha", style="color: green;", reversed>
<li>List Item 1</li>
<li>List Item 2</li>
<li>List Item 3</li>
<li>List Item 4</li>
<li>List Item 5</li>
</ol>
</div>
</section>
</main>
<footer>
</footer>
</body>
</html>