-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcss_styling_1.html
More file actions
213 lines (208 loc) · 10.1 KB
/
css_styling_1.html
File metadata and controls
213 lines (208 loc) · 10.1 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
208
209
210
211
212
213
<!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 Links | 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 {color: gold; font-size: 40px;}
h2 {color: lightgreen; font-size: 30px; margin: 1rem 2rem; text-decoration: underline;}
p {color: white; font-size: 30px; line-height: 1.5; word-spacing: 2px; letter-spacing: 1px;}
ul {font-size: 30px;}
ul li:nth-child(2) {color: red;} /* Change colour of listed item 2 to red */
ul li a {text-decoration: none; color: skyblue;} /* Change colour of hyperlink */
ul li a:visited {color: green;} /* Change 'visited' colour when clicked */
ul li a:hover {color: darkblue; text-decoration: underline; opacity: 0.5;} /* Change colour when cursor hovers over */
ul li a:focus {color: darkblue; text-decoration: underline; background-color: gold;} /* Change colour when link is selected by pressing tab */
ul li a:active {color: red; text-decoration: underline;} /* Change colour while clicked */
ol {font-size: 30px;}
ol li:nth-child(even) {color: green;} /* Change colour of even numbered list items */
ol li:nth-child(odd) {color: blue;} /* Change colour of odd numbered list items */
/* Unordered List styles */
ul.circle {list-style-type: circle; color: white;}
ul.disc {list-style-type: disc; color: white;}
ul.square {list-style-type: square; color: white;}
/* Ordered List styles */
ol.lower-alpha {list-style-type: lower-alpha; color: white;}
ol.lower-roman {list-style-type: lower-roman; color: white;}
ol.upper-alpha {list-style-type: upper-alpha; color: white;}
ol.upper-roman {list-style-type: upper-roman; color: white;}
ol.disc {list-style-type: disc; color: white;}
ol.circle {list-style-type: circle; color: white;}
ol.square {list-style-type: square; color: white;}
ol.none {list-style-type: none; color: white;}
ol.decimal {list-style-type: decimal; color: white;}
/* Text formatting */
span.highlight {background-color: orange; color: black;}
span.italic {font-style: italic;}
span.bold {font-weight: bold;}
span.underline {text-decoration: underline;}
span.strikethrough {text-decoration: line-through;}
/* Structure */
body
{
background-color: rgb(13, 0, 43);
font-family: Arial;
}
header
{
background-color: rgb(4, 32, 0);
border: 5px solid white;
width: 80%;
padding: 2em;
margin: 2em;
text-align: center;
}
div
{
background-color: rgb(59, 0, 0);
border: 5px dashed white;
padding: 2em 5em;
margin: 2em;
}
.section1, .section2, .section3,
.section4, .section5, .section6
{
background-color: rgb(122, 39, 0);
border: 5px solid white;
width: 80%;
padding: 2em;
margin: 2em;
}
.checkmark
{
list-style-image: url('https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR7AxnBRDKGzy-NpCROQ566ZtlzQ-P7U9bJHQ&s.png');
list-style: square url('https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR7AxnBRDKGzy-NpCROQ566ZtlzQ-P7U9bJHQ&s.png')
inside;
}
::marker /* Format all bullet points of listed/unordered lists. Use ul li::marker for only formatting unordered lists */
{
font-family: fantasy;
}
</style>
</head>
<body>
<header>
<h1>CSS Styling</h1>
</header>
<main>
<section class="section1">
<h2>This is a page about CSS styling</h2>
<div>
<p>
Below are a list of CSS links. Opacity of 0.5 has been applied to the hyperlinks, meaning they will turn slightly transparent
when they have been hovered over. CSS opacity values from 0.0 - 1.0. 0 = invisible, 1 = fully visible.
</p>
</div>
<div>
<ul class="circle", style="list-style-position: inside; text-align: center;">
<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="section2">
<h2>Section 2</h2>
<div>
<p>
This is <span class="underline">section 2</span> of the CSS styling page. This section will be covering ordered list (ol) instead of
unordered list (ul) and applying a range of listing and hyperlink styles.
</p>
</div>
<div>
<ol class="upper-alpha", style="list-style-position: outside;">
<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="section3">
<h2>Section 3</h2>
<div>
<p>
This is <span class="underline">section 3</span> of the CSS styling page. This section will be covering
<span class="highlight">custom ordered lists (ol)</span> instead of unordered list (ul) and applying a range of listing and hyperlink styles.
</p>
</div>
<div>
<p style="padding-bottom: 1em;">The below is a decimal (default) ordered list starting from 5.</p>
<ol class="decimal", 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 value="10"><a href="#">Ordered List 4 - value set to 10.</a></li>
<li><a href="#">Ordered List 5</a></li>
</ol>
</div>
</section>
<section class="section4">
<h2>Section 4</h2>
<div>
<p>
This is <span class="underline">section 4</span> of the CSS styling page. This section will be covering
<span class="highlight">custom ordered lists (ol)</span> instead of unordered list (ul) and applying a range of listing and hyperlink styles.
</p>
</div>
<div>
<p style="padding-bottom: 1em;">The below is an ordered list using roman numerals (upper-roman).</p>
<ol class="upper-roman">
<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="section5">
<h2>Section 5</h2>
<div>
<p>
This is <span class="underline">section 5</span> of the CSS styling page. This section will be covering
<span class="highlight">custom ordered lists (ol)</span> instead of unordered list (ul) and applying a range of listing and hyperlink styles.
</p>
</div>
<div>
<p style="padding-bottom: 1em;">The below is a reversed ordered list starting from 5.</p>
<ol class="decimal", reversed>
<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="section6">
<h2>Section 6</h2>
<div>
<p>
This is section 6 using unordered lists.
</p>
</div>
<div>
<ul class="checkmark">
<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>
</main>
<footer>
</footer>
</body>
</html>