Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,910 --> 00:00:05,110
[Music]
2
00:00:05,120 --> 00:00:07,190
hello and welcome hi I'm Dave this
3
00:00:07,200 --> 00:00:09,390
tutorial is part of a beginner CSS
4
00:00:09,400 --> 00:00:11,549
series I'll be using the Chrome web
5
00:00:11,559 --> 00:00:14,310
browser the visual studio code editor
6
00:00:14,320 --> 00:00:16,310
and the live server extension for visual
7
00:00:16,320 --> 00:00:18,910
studio code to view the web page there
8
00:00:18,920 --> 00:00:21,070
are links to these tools starter code
9
00:00:21,080 --> 00:00:23,189
files and all resources in the
10
00:00:23,199 --> 00:00:25,910
description below let's move on to
11
00:00:25,920 --> 00:00:28,589
styling links with CSS you can see I've
12
00:00:28,599 --> 00:00:31,589
got Visual Studio code open I have some
13
00:00:31,599 --> 00:00:34,790
basic Styles in from the last tutorial
14
00:00:34,800 --> 00:00:37,630
where we have some padding a font size
15
00:00:37,640 --> 00:00:40,990
and a font family a small font stack set
16
00:00:41,000 --> 00:00:44,069
on the body element we're also importing
17
00:00:44,079 --> 00:00:47,229
in a font from Google fonts you can do
18
00:00:47,239 --> 00:00:49,069
that if you want to and the starter code
19
00:00:49,079 --> 00:00:50,990
is available or you can set your own
20
00:00:51,000 --> 00:00:53,709
font family stack if you want to as well
21
00:00:53,719 --> 00:00:57,270
also over in the file tree you'll see I
22
00:00:57,280 --> 00:00:58,389
have an
23
00:00:58,399 --> 00:01:01,310
index.html and in the this index I have
24
00:01:01,320 --> 00:01:04,149
not only a header with an H1 heading I
25
00:01:04,159 --> 00:01:07,070
have a main element that has about five
26
00:01:07,080 --> 00:01:08,950
paragraphs and at least four of those
27
00:01:08,960 --> 00:01:11,550
paragraphs have links in them and then I
28
00:01:11,560 --> 00:01:14,630
have a couple of other HTML files very
29
00:01:14,640 --> 00:01:16,710
very basic they just contain an H1
30
00:01:16,720 --> 00:01:18,789
element in the body that's because I
31
00:01:18,799 --> 00:01:21,230
needed something to link to so I created
32
00:01:21,240 --> 00:01:23,670
a couple of those files as well so let's
33
00:01:23,680 --> 00:01:26,590
go back to the style and I will resize
34
00:01:26,600 --> 00:01:28,590
Visual Studio code to pull it over to
35
00:01:28,600 --> 00:01:30,990
this half of the page and I'm going to
36
00:01:31,000 --> 00:01:33,950
hide the file Tree by pressing contrl B
37
00:01:33,960 --> 00:01:35,469
and we'll pretty much be able to see our
38
00:01:35,479 --> 00:01:37,670
Styles here the only thing is a long
39
00:01:37,680 --> 00:01:40,069
line like this import of the font will
40
00:01:40,079 --> 00:01:42,830
wrap now over on the right you can see
41
00:01:42,840 --> 00:01:45,069
I've got Chrome open and I'm using the
42
00:01:45,079 --> 00:01:47,350
live server extension so anytime we make
43
00:01:47,360 --> 00:01:49,709
an update to our CSS we'll automatically
44
00:01:49,719 --> 00:01:51,749
see it over here on the right styling
45
00:01:51,759 --> 00:01:54,670
our hypertext links is really an
46
00:01:54,680 --> 00:01:57,550
extension of the typography that we just
47
00:01:57,560 --> 00:01:59,389
covered in the last tutorial in this
48
00:01:59,399 --> 00:02:02,190
series because it's still text so a lot
49
00:02:02,200 --> 00:02:04,149
of the things we learn about typography
50
00:02:04,159 --> 00:02:07,469
we can apply to our links but also these
51
00:02:07,479 --> 00:02:09,869
links have their own default styles that
52
00:02:09,879 --> 00:02:12,030
are different from the rest of the text
53
00:02:12,040 --> 00:02:14,750
on a page and when we talk about links
54
00:02:14,760 --> 00:02:16,910
in HTML we're talking about an anchor
55
00:02:16,920 --> 00:02:19,790
tag and usually that links to something
56
00:02:19,800 --> 00:02:21,910
with an href attribute so these first
57
00:02:21,920 --> 00:02:24,150
two links that I have link to Google
58
00:02:24,160 --> 00:02:25,949
searches there are different searches
59
00:02:25,959 --> 00:02:27,830
one searches for web links and one
60
00:02:27,840 --> 00:02:30,470
searches for hypertext links
61
00:02:30,480 --> 00:02:32,150
and then I've got a couple of links that
62
00:02:32,160 --> 00:02:34,509
just go to the other two HTML Pages we
63
00:02:34,519 --> 00:02:36,869
created guitars and JavaScript although
64
00:02:36,879 --> 00:02:38,710
those pages actually do not have that
65
00:02:38,720 --> 00:02:40,910
content just went ahead and created
66
00:02:40,920 --> 00:02:43,149
links that would hold that content so
67
00:02:43,159 --> 00:02:45,390
let's note the default styles of these
68
00:02:45,400 --> 00:02:47,550
links they're underlined that's the
69
00:02:47,560 --> 00:02:50,309
first thing to note also if the link has
70
00:02:50,319 --> 00:02:53,270
not been visited it's a blue color but
71
00:02:53,280 --> 00:02:56,190
notice the hypertext links link that we
72
00:02:56,200 --> 00:02:59,030
have here and it is purple so we know
73
00:02:59,040 --> 00:03:00,830
this is a visitor link and we can tell
74
00:03:00,840 --> 00:03:03,509
all of this just by looking at the page
75
00:03:03,519 --> 00:03:05,949
also when we point at a link it changes
76
00:03:05,959 --> 00:03:09,309
our cursor from this Arrow to a pointer
77
00:03:09,319 --> 00:03:11,270
it's a little hand pointing its finger
78
00:03:11,280 --> 00:03:13,750
at the link so that is called a pointer
79
00:03:13,760 --> 00:03:15,869
cursor and then there's another default
80
00:03:15,879 --> 00:03:18,190
style that we can't even see yet and
81
00:03:18,200 --> 00:03:19,869
that is when we click on a link so I'm
82
00:03:19,879 --> 00:03:21,430
going to click and hold down on this
83
00:03:21,440 --> 00:03:24,910
link and it turns red so this is when
84
00:03:24,920 --> 00:03:27,390
the link is active and that is another
85
00:03:27,400 --> 00:03:30,070
default style that is set so I'm to go
86
00:03:30,080 --> 00:03:31,789
ahead and let go and it goes back to
87
00:03:31,799 --> 00:03:34,550
purple without visiting the link and if
88
00:03:34,560 --> 00:03:36,110
we did visit the link and come back it
89
00:03:36,120 --> 00:03:38,630
would still be purple as visited so now
90
00:03:38,640 --> 00:03:40,190
that we know the default Styles let's
91
00:03:40,200 --> 00:03:42,789
look at how those are set the first one
92
00:03:42,799 --> 00:03:45,390
being text
93
00:03:45,400 --> 00:03:47,869
decoration that we would set and that is
94
00:03:47,879 --> 00:03:49,869
what controls the underline so the
95
00:03:49,879 --> 00:03:52,030
default would be underline and if we
96
00:03:52,040 --> 00:03:55,390
save we shouldn't see any difference but
97
00:03:55,400 --> 00:03:57,789
often times developers want to take away
98
00:03:57,799 --> 00:04:00,030
that underline and style something
99
00:04:00,040 --> 00:04:02,869
different you do want to make sure that
100
00:04:02,879 --> 00:04:05,350
it still indicates somehow that these
101
00:04:05,360 --> 00:04:07,470
are links you want them to stand out in
102
00:04:07,480 --> 00:04:09,589
some way and an underline is a good way
103
00:04:09,599 --> 00:04:11,550
for that to happen but if you want to
104
00:04:11,560 --> 00:04:13,910
take that away you can but you have to
105
00:04:13,920 --> 00:04:15,990
do something else to make the link stand
106
00:04:16,000 --> 00:04:19,110
out okay we also mentioned the cursor so
107
00:04:19,120 --> 00:04:22,310
we can set a cursor but really cursors
108
00:04:22,320 --> 00:04:24,150
have semantic values and I'll see what
109
00:04:24,160 --> 00:04:26,150
Visual Studio code pulls up there's lots
110
00:04:26,160 --> 00:04:28,590
of different choices here but let's look
111
00:04:28,600 --> 00:04:31,550
for example at a not allowed cursor and
112
00:04:31,560 --> 00:04:34,670
it has a semantic value it tells us
113
00:04:34,680 --> 00:04:36,909
something just when we see it so when I
114
00:04:36,919 --> 00:04:39,230
point at JavaScript you can see we get
115
00:04:39,240 --> 00:04:41,710
the little icon that says this is not
116
00:04:41,720 --> 00:04:44,310
allowed and we know what that means so
117
00:04:44,320 --> 00:04:46,270
really we don't want to change that from
118
00:04:46,280 --> 00:04:49,590
a pointer most of the time there is not
119
00:04:49,600 --> 00:04:51,950
really a reason to do that so let's keep
120
00:04:51,960 --> 00:04:53,909
that as pointer but I'll leave that here
121
00:04:53,919 --> 00:04:56,710
so you know the cursor can be set to
122
00:04:56,720 --> 00:04:58,550
different values and of course the
123
00:04:58,560 --> 00:05:00,590
starting color before the link has been
124
00:05:00,600 --> 00:05:03,310
clicked is just set by color and here we
125
00:05:03,320 --> 00:05:05,950
see blue is the default color and I
126
00:05:05,960 --> 00:05:08,390
believe that is the actual default color
127
00:05:08,400 --> 00:05:11,029
and not some variant of blue let me save
128
00:05:11,039 --> 00:05:13,990
again and see if I see a difference and
129
00:05:14,000 --> 00:05:16,350
no it really looks the same to me but it
130
00:05:16,360 --> 00:05:19,189
may look different to you but once I set
131
00:05:19,199 --> 00:05:21,110
this to Blue notice what happens to the
132
00:05:21,120 --> 00:05:23,710
visited link it's changed because it
133
00:05:23,720 --> 00:05:28,189
overwrote the default value and then we
134
00:05:28,199 --> 00:05:30,110
haven't said anything for the visited
135
00:05:30,120 --> 00:05:31,990
link so we need to learn how to do that
136
00:05:32,000 --> 00:05:34,430
as well so what I'm about to show you is
137
00:05:34,440 --> 00:05:36,990
called a pseudo class so we'll once
138
00:05:37,000 --> 00:05:39,670
again select the anchor element but now
139
00:05:39,680 --> 00:05:43,469
we put a colon and now I can put a
140
00:05:43,479 --> 00:05:45,710
definition after here that defines which
141
00:05:45,720 --> 00:05:48,469
pseudo class that I want to select and
142
00:05:48,479 --> 00:05:51,430
right now I want to select the visited
143
00:05:51,440 --> 00:05:53,550
pseudo class and pseudo classes
144
00:05:53,560 --> 00:05:55,950
represent the current state of the
145
00:05:55,960 --> 00:05:58,350
element because a state of an anchor
146
00:05:58,360 --> 00:06:00,870
element can change it has either been
147
00:06:00,880 --> 00:06:02,710
visited or it hasn't and there are some
148
00:06:02,720 --> 00:06:04,909
others that we'll cover as well so for
149
00:06:04,919 --> 00:06:07,309
visited let's go ahead and put this back
150
00:06:07,319 --> 00:06:11,189
to the default and save and now you can
151
00:06:11,199 --> 00:06:13,670
see our hypertext link is once again
152
00:06:13,680 --> 00:06:15,990
purple now our other links haven't been
153
00:06:16,000 --> 00:06:18,510
visited so they're still blue now let's
154
00:06:18,520 --> 00:06:20,510
look at another pseudo class that we can
155
00:06:20,520 --> 00:06:23,189
Define and this pseudo class is called
156
00:06:23,199 --> 00:06:25,189
hover when we hover over the link it
157
00:06:25,199 --> 00:06:27,070
doesn't have a default value right now
158
00:06:27,080 --> 00:06:28,670
if we hover over a link it doesn't
159
00:06:28,680 --> 00:06:30,950
change at all either the visited or the
160
00:06:30,960 --> 00:06:33,510
not visited link both of them still just
161
00:06:33,520 --> 00:06:35,510
stay the same so let's go ahead and
162
00:06:35,520 --> 00:06:38,150
change this and for now let's just
163
00:06:38,160 --> 00:06:40,430
choose a different blue and I'm going to
164
00:06:40,440 --> 00:06:42,510
show you a trick or two where you can
165
00:06:42,520 --> 00:06:44,870
choose something kind of in the same
166
00:06:44,880 --> 00:06:47,230
range of the color you have selected for
167
00:06:47,240 --> 00:06:49,790
your link but first let's just choose a
168
00:06:49,800 --> 00:06:53,110
blue randomly here so now when we hover
169
00:06:53,120 --> 00:06:55,469
notice JavaScript is changing colors
170
00:06:55,479 --> 00:06:57,749
when I hover over it and even the
171
00:06:57,759 --> 00:07:00,430
visited hypertext link will change color
172
00:07:00,440 --> 00:07:02,430
as well because now when we hover over
173
00:07:02,440 --> 00:07:04,550
the link we have changed that state it's
174
00:07:04,560 --> 00:07:06,749
now in the hover State and it is
175
00:07:06,759 --> 00:07:08,710
changing the color of the link and then
176
00:07:08,720 --> 00:07:11,550
remember we still have the active State
177
00:07:11,560 --> 00:07:14,990
as well but right now that's not working
178
00:07:15,000 --> 00:07:17,629
either because that was a default style
179
00:07:17,639 --> 00:07:20,029
and we have overwritten that what has
180
00:07:20,039 --> 00:07:22,869
followed has been visited in Hover and
181
00:07:22,879 --> 00:07:24,550
really we don't have the default style
182
00:07:24,560 --> 00:07:27,110
applied anymore so let's go ahead and
183
00:07:27,120 --> 00:07:30,270
put in that active link
184
00:07:30,280 --> 00:07:32,070
and we can change it to something like
185
00:07:32,080 --> 00:07:34,270
what it was I think it was red so that
186
00:07:34,280 --> 00:07:37,029
will definitely Stand Out select that
187
00:07:37,039 --> 00:07:39,230
and now when I click hypertext link it
188
00:07:39,240 --> 00:07:41,589
definitely turns red and I think I
189
00:07:41,599 --> 00:07:43,070
visited the link and now we're searching
190
00:07:43,080 --> 00:07:45,230
for hypertext link so I'll go back to
191
00:07:45,240 --> 00:07:47,830
our page and we can see that this link
192
00:07:47,840 --> 00:07:50,189
was visited but if I click and hold down
193
00:07:50,199 --> 00:07:51,869
we can see that it's active and now I'll
194
00:07:51,879 --> 00:07:54,149
just pull away and not visit the link
195
00:07:54,159 --> 00:07:56,629
now we have to consider specificity and
196
00:07:56,639 --> 00:07:58,990
we also have to consider the order these
197
00:07:59,000 --> 00:08:02,309
are in for the Cascade so if we put
198
00:08:02,319 --> 00:08:07,110
visited above our anchor selector
199
00:08:07,120 --> 00:08:10,350
visited will still be applied here even
200
00:08:10,360 --> 00:08:12,350
though the anchor selector comes
201
00:08:12,360 --> 00:08:14,430
afterwards in the Cascade and that's
202
00:08:14,440 --> 00:08:16,830
because this visited pseudo class has
203
00:08:16,840 --> 00:08:20,029
more specificity than just an element
204
00:08:20,039 --> 00:08:21,790
just the anchor element and we can see
205
00:08:21,800 --> 00:08:23,510
that if we go to the specificity
206
00:08:23,520 --> 00:08:25,510
calculator and I have this linked to in
207
00:08:25,520 --> 00:08:27,950
the resources and now if I just put in
208
00:08:27,960 --> 00:08:29,950
an anchor element you you can see the
209
00:08:29,960 --> 00:08:31,310
score is just
210
00:08:31,320 --> 00:08:34,589
01 but if I put in an anchor element
211
00:08:34,599 --> 00:08:37,670
with a visited or any other pseudo
212
00:08:37,680 --> 00:08:40,670
selector now the pseudo selector here is
213
00:08:40,680 --> 00:08:43,029
a class I said pseudo selector a pseudo
214
00:08:43,039 --> 00:08:45,829
class I'm selecting the pseudo class
215
00:08:45,839 --> 00:08:49,190
classes attributes and pseudo classes so
216
00:08:49,200 --> 00:08:52,430
this has more specificity and that's why
217
00:08:52,440 --> 00:08:54,470
the visited link continues to stay
218
00:08:54,480 --> 00:08:57,070
purple even though the anchor element
219
00:08:57,080 --> 00:08:59,470
comes afterwards in the Cascade but
220
00:08:59,480 --> 00:09:01,190
that's not usually the order we want
221
00:09:01,200 --> 00:09:02,750
things we usually kind of want to think
222
00:09:02,760 --> 00:09:04,509
about it in the order that we would have
223
00:09:04,519 --> 00:09:06,430
them so I'm going to put that visited
224
00:09:06,440 --> 00:09:10,069
back but now visited hover and active
225
00:09:10,079 --> 00:09:13,310
all have the same specificity and one
226
00:09:13,320 --> 00:09:15,630
can overwrite the other so we really
227
00:09:15,640 --> 00:09:17,389
have to think about the order we put
228
00:09:17,399 --> 00:09:20,150
those in let me save this and right now
229
00:09:20,160 --> 00:09:21,870
they're all working because this is the
230
00:09:21,880 --> 00:09:24,310
proper order have your anchor tag and
231
00:09:24,320 --> 00:09:26,430
then have your visited pseudo class your
232
00:09:26,440 --> 00:09:28,790
hover pseudo class and finally you're
233
00:09:28,800 --> 00:09:30,670
active and they should all work so when
234
00:09:30,680 --> 00:09:33,750
we hover it works visited of course is
235
00:09:33,760 --> 00:09:36,509
working and if I click active it is
236
00:09:36,519 --> 00:09:39,590
working however if I rearrange these
237
00:09:39,600 --> 00:09:42,110
they may not so let me go ahead and take
238
00:09:42,120 --> 00:09:45,550
hover and put it above visited and so
239
00:09:45,560 --> 00:09:48,509
now visited comes after in the Cascade
240
00:09:48,519 --> 00:09:51,389
and when I hover that still works it
241
00:09:51,399 --> 00:09:52,990
hasn't been visited but let's check our
242
00:09:53,000 --> 00:09:55,509
visited link the hover doesn't work
243
00:09:55,519 --> 00:09:57,870
anymore so it's important to have these
244
00:09:57,880 --> 00:10:00,630
in the correct order I'll take cover and
245
00:10:00,640 --> 00:10:02,910
put it back where it belongs in this
246
00:10:02,920 --> 00:10:06,110
order so you want your anchor tag then
247
00:10:06,120 --> 00:10:08,750
your pseudo class of visited then your
248
00:10:08,760 --> 00:10:11,790
pseudo class of hover and finally your
249
00:10:11,800 --> 00:10:15,030
pseudo class of active and there's one
250
00:10:15,040 --> 00:10:17,509
more very important pseudo class and you
251
00:10:17,519 --> 00:10:20,069
usually see it added to the same style
252
00:10:20,079 --> 00:10:22,910
as the hover and we can do that here
253
00:10:22,920 --> 00:10:25,790
just by putting a comma and then putting
254
00:10:25,800 --> 00:10:28,910
in the focus pseudo class and this
255
00:10:28,920 --> 00:10:31,150
really makes your page more accessible
256
00:10:31,160 --> 00:10:34,350
because if a visitor or a user of your
257
00:10:34,360 --> 00:10:36,470
page is using a screen reader and
258
00:10:36,480 --> 00:10:38,069
instead of using a mouse they are
259
00:10:38,079 --> 00:10:41,190
tabbing through your page notice that
260
00:10:41,200 --> 00:10:43,990
right now we've selected the first link
261
00:10:44,000 --> 00:10:46,069
here and it has the outline around it I
262
00:10:46,079 --> 00:10:48,750
am tabbing through the links and by
263
00:10:48,760 --> 00:10:52,269
doing that when it has focus it is
264
00:10:52,279 --> 00:10:54,389
changing the color of the link just like
265
00:10:54,399 --> 00:10:56,350
we did with the hover and that's
266
00:10:56,360 --> 00:10:58,629
important to make your page accessible
267
00:10:58,639 --> 00:11:00,910
as well okay I'm going to take the focus
268
00:11:00,920 --> 00:11:03,069
off of that link and I'm going to remove
269
00:11:03,079 --> 00:11:05,069
all of these in the anchor tag all of
270
00:11:05,079 --> 00:11:06,829
these Styles because they're the default
271
00:11:06,839 --> 00:11:09,629
Styles anyway and what I do want to put
272
00:11:09,639 --> 00:11:12,670
in here is a different color we often
273
00:11:12,680 --> 00:11:15,870
see a color of black we already have
274
00:11:15,880 --> 00:11:19,590
black text but notice now the Links are
275
00:11:19,600 --> 00:11:22,110
underlined with the black text and I
276
00:11:22,120 --> 00:11:24,670
commonly see this on web pages as well
277
00:11:24,680 --> 00:11:26,110
so we don't always take away the
278
00:11:26,120 --> 00:11:28,310
underline sometimes we use the same
279
00:11:28,320 --> 00:11:30,509
color as the rest of the the text but we
280
00:11:30,519 --> 00:11:32,790
add the underline to make them Stand Out
281
00:11:32,800 --> 00:11:34,870
notice you can still have a hover you
282
00:11:34,880 --> 00:11:36,829
can still have a visited color if you
283
00:11:36,839 --> 00:11:39,430
want to but often times you don't see a
284
00:11:39,440 --> 00:11:41,269
visited color either so we can just
285
00:11:41,279 --> 00:11:42,829
comment that out and leave it in the
286
00:11:42,839 --> 00:11:45,710
code and now we don't have a different
287
00:11:45,720 --> 00:11:48,190
color for a visited link and that's okay
288
00:11:48,200 --> 00:11:50,710
if you want to do that but we still have
289
00:11:50,720 --> 00:11:53,629
a hover color and we still have a focus
290
00:11:53,639 --> 00:11:56,949
color as well so now let me back this up
291
00:11:56,959 --> 00:11:58,430
just I wanted to show a different
292
00:11:58,440 --> 00:12:00,670
version of that I'll go ahead and put
293
00:12:00,680 --> 00:12:04,190
the visited color back in and up here
294
00:12:04,200 --> 00:12:06,350
let's go ahead and put in
295
00:12:06,360 --> 00:12:08,670
blue let's do a different color though
296
00:12:08,680 --> 00:12:11,750
let's do steel blue I like that color
297
00:12:11,760 --> 00:12:13,870
we'll save and now we have steel Blue
298
00:12:13,880 --> 00:12:17,310
Links and when we Mouse over it looks
299
00:12:17,320 --> 00:12:19,509
okay but let me show you a couple of
300
00:12:19,519 --> 00:12:21,590
things you can do to stay within the
301
00:12:21,600 --> 00:12:25,150
same color and yet make it noticeable
302
00:12:25,160 --> 00:12:27,509
that you are hovering going back to when
303
00:12:27,519 --> 00:12:29,750
we covered colors in in the different
304
00:12:29,760 --> 00:12:32,389
tutorial we learned how to use the VSS
305
00:12:32,399 --> 00:12:34,670
code color selector so I moused over the
306
00:12:34,680 --> 00:12:36,710
color here and it pulled up the color
307
00:12:36,720 --> 00:12:38,470
selector and I can click on the color
308
00:12:38,480 --> 00:12:42,949
bar and go to hex from the RGB and I can
309
00:12:42,959 --> 00:12:45,269
also go to hsl and I'm going to choose
310
00:12:45,279 --> 00:12:48,790
hsl here and now let's leave it at that
311
00:12:48,800 --> 00:12:54,350
and notice it's 207 44 and 49 now let me
312
00:12:54,360 --> 00:12:56,350
just copy
313
00:12:56,360 --> 00:12:58,710
this and I'm going to take it to our
314
00:12:58,720 --> 00:13:01,350
hover instead of the Dodger blue and now
315
00:13:01,360 --> 00:13:04,110
right here this number is the number we
316
00:13:04,120 --> 00:13:06,710
want to change it changes the color and
317
00:13:06,720 --> 00:13:09,829
so that pulled it up and now we can just
318
00:13:09,839 --> 00:13:12,629
make this a little lighter choosing
319
00:13:12,639 --> 00:13:14,430
something different on the color wheel
320
00:13:14,440 --> 00:13:16,590
if you remember the way these numbers
321
00:13:16,600 --> 00:13:18,189
work it's just something different in
322
00:13:18,199 --> 00:13:20,550
the wheel I'll take it down to 189
323
00:13:20,560 --> 00:13:22,189
notice the other numbers are still the
324
00:13:22,199 --> 00:13:25,590
same 44% and 49 so we've just changed
325
00:13:25,600 --> 00:13:27,470
the shade just a little bit on the color
326
00:13:27,480 --> 00:13:30,509
wheel and when we Mouse over
327
00:13:30,519 --> 00:13:32,829
it kind of goes with the color theme and
328
00:13:32,839 --> 00:13:34,710
that is a good way to change that so in
329
00:13:34,720 --> 00:13:37,629
hsl you're really only changing the
330
00:13:37,639 --> 00:13:39,590
first number and you're selecting a
331
00:13:39,600 --> 00:13:42,829
number close to what you had and that is
332
00:13:42,839 --> 00:13:45,509
one way to get a similar color that
333
00:13:45,519 --> 00:13:48,230
complements what you originally had
334
00:13:48,240 --> 00:13:50,629
another approach and I will go ahead and
335
00:13:50,639 --> 00:13:53,030
comment out the
336
00:13:53,040 --> 00:13:56,310
color but another approach is to use an
337
00:13:56,320 --> 00:13:59,189
opacity property which is making
338
00:13:59,199 --> 00:14:00,629
something
339
00:14:00,639 --> 00:14:03,550
transparent and remember with colors we
340
00:14:03,560 --> 00:14:06,629
could add that right inside of this hsl
341
00:14:06,639 --> 00:14:08,509
as well but I'll show you how to do it
342
00:14:08,519 --> 00:14:10,910
here with the opacity property and let's
343
00:14:10,920 --> 00:14:14,389
put this to one would be the Max and
344
00:14:14,399 --> 00:14:17,509
zero would be completely uh invisible
345
00:14:17,519 --> 00:14:20,509
transparent so let's put this around
346
00:14:20,519 --> 00:14:23,829
0.9 to just give it a little bit of
347
00:14:23,839 --> 00:14:26,629
transparency when we Mouse over and you
348
00:14:26,639 --> 00:14:28,670
can see the color changes it's keeping
349
00:14:28,680 --> 00:14:31,749
the same color but it just gets a little
350
00:14:31,759 --> 00:14:34,189
bit lighter and maybe the8 would even be
351
00:14:34,199 --> 00:14:37,629
more noticeable let's try
352
00:14:37,639 --> 00:14:40,949
that and that also works but when you
353
00:14:40,959 --> 00:14:43,710
learn about this note that opacity will
354
00:14:43,720 --> 00:14:46,230
change everything so if you use this on
355
00:14:46,240 --> 00:14:49,470
something else let's go up here and
356
00:14:49,480 --> 00:14:52,790
let's put in the main
357
00:14:52,800 --> 00:14:56,790
element now if I put this in it made
358
00:14:56,800 --> 00:14:58,189
everything on the page a little bit
359
00:14:58,199 --> 00:14:59,749
lighter I'll make it much more
360
00:14:59,759 --> 00:15:03,269
noticeable here now that made all of the
361
00:15:03,279 --> 00:15:05,749
paragraphs much more transparent so you
362
00:15:05,759 --> 00:15:08,110
want to be careful when you use that now
363
00:15:08,120 --> 00:15:12,350
remember also in the hsl and also in
364
00:15:12,360 --> 00:15:15,110
rgba there is a channel that allows you
365
00:15:15,120 --> 00:15:18,710
to add a transparency value so here we
366
00:15:18,720 --> 00:15:21,990
could also do
367
00:15:22,000 --> 00:15:24,590
0.8 and now when I Mouse over we'll
368
00:15:24,600 --> 00:15:26,230
still get a
369
00:15:26,240 --> 00:15:29,150
transparency as well and it's ALS o
370
00:15:29,160 --> 00:15:31,470
changing color there so if we wanted to
371
00:15:31,480 --> 00:15:33,629
we could put this back to the exact same
372
00:15:33,639 --> 00:15:36,350
color but now we've added the
373
00:15:36,360 --> 00:15:38,749
transparency so if we save and mouse
374
00:15:38,759 --> 00:15:41,309
over we still get a little lighter color
375
00:15:41,319 --> 00:15:43,590
and it's really the same exact shade
376
00:15:43,600 --> 00:15:45,110
we're just lightening it up with a
377
00:15:45,120 --> 00:15:47,189
little bit of transparency there okay
378
00:15:47,199 --> 00:15:48,790
before we finish I just want to
379
00:15:48,800 --> 00:15:51,189
emphasize that these pseudo classes are
380
00:15:51,199 --> 00:15:54,430
not just for changing colors you can
381
00:15:54,440 --> 00:15:56,309
adjust other things although changing
382
00:15:56,319 --> 00:15:59,470
the color of links and the visited
383
00:15:59,480 --> 00:16:02,069
hover Focus active all of those pseudo
384
00:16:02,079 --> 00:16:04,710
classes that's a common application of
385
00:16:04,720 --> 00:16:06,949
this but we could do other things as
386
00:16:06,959 --> 00:16:09,749
well one thing I have seen is changing a
387
00:16:09,759 --> 00:16:11,670
background so let's change the
388
00:16:11,680 --> 00:16:14,269
background here to gold and it will be
389
00:16:14,279 --> 00:16:16,829
kind of like a highlighter so when we
390
00:16:16,839 --> 00:16:19,430
focus and I'm tabbing through we're kind
391
00:16:19,440 --> 00:16:20,910
of highlighting The Links of course
392
00:16:20,920 --> 00:16:22,430
you'd want to choose a complimentary
393
00:16:22,440 --> 00:16:25,269
color there as well but that is
394
00:16:25,279 --> 00:16:27,910
something else I have seen before is
395
00:16:27,920 --> 00:16:29,990
kind of adding a highlight to each link
396
00:16:30,000 --> 00:16:32,910
as it has Focus or as it's hovered over
397
00:16:32,920 --> 00:16:34,829
remember to keep striving for Progress
398
00:16:34,839 --> 00:16:37,269
over Perfection and a little progress
399
00:16:37,279 --> 00:16:40,230
every day will go a very long way please
400
00:16:40,240 --> 00:16:41,790
give this video a like if it's helped
401
00:16:41,800 --> 00:16:43,910
you and thank you for watching and
402
00:16:43,920 --> 00:16:46,590
subscribing your helping my channel grow
403
00:16:46,600 --> 00:16:48,629
have a great day and let's write more
404
00:16:48,639 --> 00:16:52,680
code together very soon
29266
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.