Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,060 --> 00:00:00,690
Hey, what's up?
2
00:00:00,720 --> 00:00:05,340
Welcome to day one of CSS3 three in 30 days, my name is Brad Hussey, and I'm going to be helping you
3
00:00:05,340 --> 00:00:12,270
out over the next 30 days or so to learn CSS3 by actually building a bunch of things.
4
00:00:12,270 --> 00:00:17,400
So day one is the very beginning, and we're going to be getting started with some pretty cool stuff.
5
00:00:17,640 --> 00:00:20,880
So let me show you what we're going to be doing right here in the browser.
6
00:00:21,240 --> 00:00:26,220
So right here over in the browser this day, one sees three fancy buttons I'm calling it.
7
00:00:26,430 --> 00:00:30,980
We're going to be making some buttons exclusively with three just to kind of what you're whistling,
8
00:00:30,990 --> 00:00:32,460
get you excited about what's to come.
9
00:00:32,580 --> 00:00:36,300
This is a pretty cool thing, something you can use immediately in your websites and all that sort of
10
00:00:36,300 --> 00:00:36,570
stuff.
11
00:00:37,470 --> 00:00:38,240
Here's the shell.
12
00:00:38,250 --> 00:00:41,400
You've seen that in the previous video I showed you kind of the outline.
13
00:00:41,400 --> 00:00:42,900
This is what every lesson is going to look like.
14
00:00:43,080 --> 00:00:46,500
We're not going to be coding that up, but you're welcome to check out the success in the theme files
15
00:00:46,500 --> 00:00:46,800
and stuff.
16
00:00:46,800 --> 00:00:47,340
That's cool.
17
00:00:47,910 --> 00:00:52,650
But what we're going to be building is going to be further down here in the the web page so you can
18
00:00:52,650 --> 00:00:54,210
see we've got the sandbox.
19
00:00:54,540 --> 00:00:59,040
This is what you're going to be using to you're going to manipulate this to make it look like the final
20
00:00:59,040 --> 00:00:59,460
result.
21
00:00:59,760 --> 00:01:02,070
Now below, here is the final result with scroll down.
22
00:01:02,700 --> 00:01:05,340
We've got the final result and this is what we're going to be making.
23
00:01:05,350 --> 00:01:07,290
This is the final example of what we're gonna be doing.
24
00:01:07,620 --> 00:01:09,030
We got the Facebook style buttons.
25
00:01:09,030 --> 00:01:13,680
We've got the 3D buttons, you know, with some 3D cool effects in the circle and all that sort of stuff.
26
00:01:13,980 --> 00:01:16,620
We've got the gradient bordered buttons with some cool hover effects.
27
00:01:16,620 --> 00:01:18,000
You can see that here.
28
00:01:18,360 --> 00:01:20,850
The border of these buttons have gradients.
29
00:01:20,970 --> 00:01:25,020
That's the CSS three kind of hacking their animated buttons.
30
00:01:25,020 --> 00:01:29,460
So when you hover over the buttons, you get some cool animation effects and then adding an element
31
00:01:29,460 --> 00:01:29,840
in there.
32
00:01:30,750 --> 00:01:35,280
We've got toggle switches, changes, the text and the button in the color and all that sort of thing,
33
00:01:35,280 --> 00:01:37,110
the position of the inside switch.
34
00:01:37,110 --> 00:01:40,470
And then, you know, you click to activate a button, those sorts of things.
35
00:01:41,010 --> 00:01:46,950
So that is what we're going to be building in our lesson today for day one six three fancy buttons.
36
00:01:46,950 --> 00:01:52,770
So what you need to do before you get started is download the course file so you can follow along and
37
00:01:52,770 --> 00:01:54,420
actually start making something right away.
38
00:02:00,770 --> 00:02:06,440
Just click the link to download the course files and you'll be given a file that our folder a zip file
39
00:02:06,440 --> 00:02:08,840
with a folder in it that's called one dash fancy buttons.
40
00:02:08,870 --> 00:02:14,810
It's going to have an index file like so it's going to have a sandbox.
41
00:02:14,810 --> 00:02:17,990
That's the CSV file, which you're going to be using to add your own success.
42
00:02:18,260 --> 00:02:23,180
And a final does the CSV file, which has everything that you need to reference.
43
00:02:23,180 --> 00:02:27,080
If you go through the code, you messed something up or you're not quite sure about something that right
44
00:02:27,080 --> 00:02:28,670
there is going to help you out.
45
00:02:29,210 --> 00:02:32,780
You can use that for reference while you're building your projects.
46
00:02:33,530 --> 00:02:36,560
And that final success is what styles over here in the browser.
47
00:02:36,890 --> 00:02:38,330
This stuff over here.
48
00:02:38,690 --> 00:02:44,720
So the sandbox style this this section, the final result is right here.
49
00:02:45,470 --> 00:02:47,920
So those are the three files that you're going to get in this.
50
00:02:47,930 --> 00:02:50,330
The the course files for this lesson.
51
00:02:50,840 --> 00:02:53,440
And what you need to do is just open up your index following your browser.
52
00:02:53,450 --> 00:03:00,410
I'm using Adam as my code editor, so I got my course files in that code editor right here.
53
00:03:00,410 --> 00:03:06,320
But then it also has a feature where you can open up the index HTML file in the preview over here.
54
00:03:06,320 --> 00:03:09,710
So that's what I'm doing, but you can open it up in a browser like Safari or Chrome.
55
00:03:10,310 --> 00:03:13,850
So I suggest you go ahead and do that and then open up your code editor.
56
00:03:14,060 --> 00:03:15,110
Open up your sandbox.
57
00:03:15,110 --> 00:03:15,850
That success.
58
00:03:15,860 --> 00:03:19,400
Now that we're here, we should be at the same spot.
59
00:03:19,790 --> 00:03:22,880
What we're going to start doing now is styling up these Facebook style buttons.
60
00:03:22,920 --> 00:03:24,680
Let's just jump in Northeast any more time.
61
00:03:25,340 --> 00:03:30,650
So in the index file, you're going to see the CSS classes that I use for the Facebook style buttons,
62
00:03:30,650 --> 00:03:34,550
Facebook style button and then Facebook style dark and light.
63
00:03:35,810 --> 00:03:41,780
So let's just jump right in, we're going to say Facebook style BB10, and then we're going to say border
64
00:03:41,780 --> 00:03:44,360
radius to pixels.
65
00:03:46,810 --> 00:03:50,080
Let's do font size 0.9 RAM.
66
00:03:50,110 --> 00:03:54,340
That's referencing the root font size rather than the parent font size.
67
00:03:54,340 --> 00:03:56,530
That's of course, he has two or three feature padding.
68
00:03:56,530 --> 00:04:00,820
We're going to go six pixels on the top and bottom, 12 pixels on the left and the right.
69
00:04:01,000 --> 00:04:02,950
Save that pop over into your browser.
70
00:04:02,950 --> 00:04:06,190
You can see already the changes are taking place.
71
00:04:06,210 --> 00:04:07,510
Looks pretty good so far.
72
00:04:07,600 --> 00:04:09,490
Nothing fancy, but you know we're getting there.
73
00:04:10,390 --> 00:04:18,100
Let's select the Facebook style, dark button Facebook style dark, and I'm going to start adding some
74
00:04:18,100 --> 00:04:19,060
box shadows.
75
00:04:19,360 --> 00:04:25,150
So just to be up to date here, we're going to use Moore's box shadow.
76
00:04:26,590 --> 00:04:32,150
And then I'm going to go ahead and say inset, and I'll explain this in a minute.
77
00:04:32,170 --> 00:04:34,530
Zero one Pixel zero zero.
78
00:04:34,840 --> 00:04:39,380
And then a color for D7 three b f.
79
00:04:39,760 --> 00:04:40,590
I'm going to copy that.
80
00:04:40,610 --> 00:04:43,180
Whoa, that needs to be a pound sign on a dollar sign.
81
00:04:44,380 --> 00:04:45,450
Paste that a couple of times.
82
00:04:45,490 --> 00:04:50,620
The second one going to change the web kit and this last one is just box shadow.
83
00:04:50,890 --> 00:04:55,000
And then I'm going to tab the the rule here.
84
00:04:55,300 --> 00:04:55,690
Oops.
85
00:04:56,260 --> 00:04:59,140
The style so that we can have them line up properly.
86
00:04:59,470 --> 00:04:59,860
Beautiful.
87
00:05:00,640 --> 00:05:00,940
All right.
88
00:05:01,090 --> 00:05:06,280
So Mars is from Mozilla browsers is for web based browsers, and box shadow was just the fallback that
89
00:05:06,520 --> 00:05:08,260
you know, modern browsers are able to pull from.
90
00:05:08,470 --> 00:05:11,200
So that's what you would do to get your box shadow.
91
00:05:11,230 --> 00:05:14,860
You can just put box shadow, but then, you know, some browsers might not recognize it, and then
92
00:05:14,860 --> 00:05:16,180
you won't have the box shadow effect.
93
00:05:16,180 --> 00:05:17,680
So it's up to you if you want to do that.
94
00:05:19,130 --> 00:05:23,480
See us this story is a bit progressive, so some browsers aren't quite up to date with certain rules
95
00:05:23,480 --> 00:05:27,830
and styles and things like that, but at the bottom of every lesson over here in the browser, you can
96
00:05:27,830 --> 00:05:29,930
see how compatible are these styles of major browsers.
97
00:05:30,140 --> 00:05:37,760
If you click on this link, it'll take you to a web site that will basically say, Can I use, you know,
98
00:05:37,760 --> 00:05:39,140
box shadow?
99
00:05:40,250 --> 00:05:47,270
And you can see see us history box shadow and where it works, it works in these versions of IEEE Firefox
100
00:05:47,270 --> 00:05:50,130
Chrome's Afari and, you know, you can kind of see.
101
00:05:50,150 --> 00:05:51,260
So basically, it says.
102
00:05:53,400 --> 00:05:57,180
On prefix, so this is prefixed styles over here in the code editor.
103
00:05:57,360 --> 00:06:01,620
These are prefixed styles, so technically we don't even really need to do that because it looks like
104
00:06:02,550 --> 00:06:09,030
ninety four point eighty eight percent of browsers are going to support the UN prefix box shadow.
105
00:06:10,870 --> 00:06:12,460
So that's pretty cool.
106
00:06:13,060 --> 00:06:17,260
Let's see Safari six, iOS default browser iOS six.
107
00:06:17,620 --> 00:06:20,610
Don't work with zero pixel value or blurb, so there's information there.
108
00:06:20,620 --> 00:06:22,660
You know, you can reference that it's up to you if you want to do that.
109
00:06:23,170 --> 00:06:25,030
So I won't waste any more of your time looking at that.
110
00:06:25,040 --> 00:06:27,040
You can do that on your own time.
111
00:06:27,490 --> 00:06:30,250
So let's go back to the style here.
112
00:06:30,340 --> 00:06:30,820
There we go.
113
00:06:31,210 --> 00:06:34,240
And let's jump back in here, and I'm going to explain this here.
114
00:06:34,240 --> 00:06:39,820
Inset, it makes the box shadow on the inside of the the box, the block level element.
115
00:06:39,840 --> 00:06:43,470
So inside of the dev, it's going to be the box.
116
00:06:43,570 --> 00:06:45,790
It was within the element rather than on the outside.
117
00:06:45,790 --> 00:06:49,030
Casting a shadow behind it is going to be inside the element itself.
118
00:06:49,630 --> 00:06:56,230
The first a number here, the first value is the horizontal, the horizontal offset.
119
00:06:57,400 --> 00:07:02,230
And that's if you put a positive number like five pixels, it's going to be shift to the right.
120
00:07:02,920 --> 00:07:05,470
And if you put negative five, it's going to go to the left.
121
00:07:05,920 --> 00:07:07,390
So at zero, it's dead center.
122
00:07:07,960 --> 00:07:09,520
The second one is the vertical offset.
123
00:07:09,520 --> 00:07:14,020
So positive number like five pixels is going to be shifted down.
124
00:07:14,020 --> 00:07:17,440
And if if you put a negative number like negative five, it's going to be shifted up.
125
00:07:17,950 --> 00:07:24,190
And then the second, the third number here is the the blur radius.
126
00:07:25,060 --> 00:07:25,920
And that's a blur.
127
00:07:25,930 --> 00:07:31,930
You want that box shadow a zero would mean a sharp line and like 10 pixels would be a blurry black shadow.
128
00:07:32,350 --> 00:07:36,190
Depending on the effect you want and this one is the spread radius.
129
00:07:36,200 --> 00:07:42,100
So if you want it to be a really big, you know, as the box shadow to spread, then you'd have a higher
130
00:07:42,100 --> 00:07:43,900
number if you don't want to do anything than zero.
131
00:07:44,290 --> 00:07:46,140
These are the only two that are required.
132
00:07:46,150 --> 00:07:50,820
These two are optional values that you don't need to put.
133
00:07:50,860 --> 00:07:53,440
And so then the last one is the color of the shadow.
134
00:07:53,440 --> 00:07:58,000
So if I say this hat over here, you're going to see just the thin hairline in the browser, and that's
135
00:07:58,000 --> 00:08:00,880
what we've created, just a thin little blue hairline, and that's all we wanted.
136
00:08:01,840 --> 00:08:10,290
All right, so next, what I want is to change the background to it's going to be four to six, seven
137
00:08:10,300 --> 00:08:14,260
be two just for the background color border.
138
00:08:15,730 --> 00:08:16,870
Solid one pixel.
139
00:08:17,140 --> 00:08:19,270
Same color as the previous color there.
140
00:08:20,200 --> 00:08:22,690
That's the Facebook blue purple color.
141
00:08:23,350 --> 00:08:28,000
Color of the text is going to be white text shadow.
142
00:08:29,890 --> 00:08:36,670
Let's go four zero one pixel zero and then three three five nine a five.
143
00:08:36,670 --> 00:08:43,060
And that's just going to be, you know, a little bit darker of a text shadow under the white text.
144
00:08:43,330 --> 00:08:45,760
So let's have a look and see what that looks like over in the browser.
145
00:08:45,760 --> 00:08:47,920
If I save that button looks good.
146
00:08:48,240 --> 00:08:53,110
Got that slight border, that little bit of a glow on the top, as if a light was shining down on the
147
00:08:53,110 --> 00:08:54,910
button to give it a little bit of depth.
148
00:08:55,270 --> 00:08:59,050
White text, slight text, shadow and under there beautiful.
149
00:08:59,050 --> 00:08:59,950
It looks great now.
150
00:08:59,950 --> 00:09:04,090
We don't have any hover or active effects when you interact with the button, so let's do that over
151
00:09:04,090 --> 00:09:04,960
here in the code editor.
152
00:09:05,800 --> 00:09:08,460
I'm going to go down a couple of spaces and Tab N1.
153
00:09:08,470 --> 00:09:10,270
That's not going to change the CSS at all.
154
00:09:10,270 --> 00:09:11,290
It's just for organization.
155
00:09:11,290 --> 00:09:16,810
I like having my related rules to be organized in a manner that I can see.
156
00:09:16,810 --> 00:09:24,400
So if I tap in, I know that this rule that I'm doing so Facebook style dark and then hover.
157
00:09:25,120 --> 00:09:32,620
I know that this rule is directly related to this rule right here, whereas these two are not as related.
158
00:09:32,620 --> 00:09:37,990
They're kind of, you know, it's more so for my own organization purposes so you can do what you want.
159
00:09:37,990 --> 00:09:40,360
But this is what I like to do, feel free to follow along in that manner.
160
00:09:41,290 --> 00:09:42,100
All right.
161
00:09:42,610 --> 00:09:49,060
So on the hover, what I want to do is change the background color to to be five for a seven.
162
00:09:50,760 --> 00:09:58,950
And I say that, and then we're going to copy this and paste it and change the hover too active so that
163
00:09:59,370 --> 00:10:07,320
what I'm going to do here is I'm going to change the background to one D four six nine eight and then
164
00:10:07,320 --> 00:10:10,680
the border color to the same.
165
00:10:12,390 --> 00:10:17,010
Save that now, if I go over here and interact with that button, hover a little bit darker, click
166
00:10:17,370 --> 00:10:18,900
an act of state a little bit darker.
167
00:10:18,900 --> 00:10:20,820
Still, the borders dark looks great.
168
00:10:21,810 --> 00:10:22,110
All right.
169
00:10:22,890 --> 00:10:26,250
Let's dial up that light button over there, so head back to our code editor here.
170
00:10:27,950 --> 00:10:29,210
A couple returns there.
171
00:10:29,420 --> 00:10:30,170
Let's go.
172
00:10:30,200 --> 00:10:32,360
Facebook style light.
173
00:10:33,230 --> 00:10:39,560
And I'm going to say the background is f six seven, f nine.
174
00:10:41,110 --> 00:10:48,170
The border is going to be a solid one pixel c d o d four zero d for.
175
00:10:49,900 --> 00:10:56,350
The border radius we already covered, that's the color of the text color is going to be for.
176
00:10:57,490 --> 00:10:57,970
Be.
177
00:10:59,200 --> 00:10:59,740
For.
178
00:11:01,510 --> 00:11:03,670
EF five, six.
179
00:11:04,970 --> 00:11:09,320
Really, that's right, yeah, that's like a grey and then the padding is good, so that's all we need
180
00:11:09,320 --> 00:11:10,220
to do for the light button.
181
00:11:10,220 --> 00:11:10,920
Let's check it out.
182
00:11:11,180 --> 00:11:13,090
It looks good, much more minimal and simple.
183
00:11:13,100 --> 00:11:14,150
I like that style.
184
00:11:14,900 --> 00:11:18,380
And now what you need to do is add to the hover and active states for that button as well.
185
00:11:18,380 --> 00:11:26,630
So a couple of returns down Talbot in Facebook style light hover and we're going to change the background
186
00:11:26,870 --> 00:11:29,090
to E9 EBIT.
187
00:11:29,510 --> 00:11:36,410
And then we're going to copy this whole rule and change this one to active and then is going to change
188
00:11:36,410 --> 00:11:37,190
the background.
189
00:11:38,350 --> 00:11:40,480
To date, daddy.
190
00:11:40,780 --> 00:11:47,320
Copy that and we're going to do is change the border caller to the same, save that.
191
00:11:47,320 --> 00:11:50,260
Check it out, interact with it, hover a little bit darker.
192
00:11:50,410 --> 00:11:51,250
Click darker.
193
00:11:51,250 --> 00:11:52,000
Still looks great.
194
00:11:52,120 --> 00:11:52,570
I like it.
195
00:11:53,140 --> 00:11:53,470
All right.
196
00:11:54,190 --> 00:11:56,170
So those are the Facebook style buttons.
197
00:11:56,680 --> 00:12:02,330
Now let's jump in to the 3D buttons down here so you can see we've got these 3D buttons.
198
00:12:02,350 --> 00:12:03,700
Let's go ahead and call those up.
199
00:12:03,850 --> 00:12:05,400
Hey, welcome back to day one.
200
00:12:05,410 --> 00:12:08,980
We're going to be coding the 3D CSS3 three buttons.
201
00:12:08,980 --> 00:12:11,890
We're still in the fancy button section of the course day one.
202
00:12:12,070 --> 00:12:13,390
But we're going to do the 3D buttons now.
203
00:12:13,390 --> 00:12:17,050
So here in the browser, you can see that two 3D buttons that are going to be styling up.
204
00:12:17,050 --> 00:12:17,920
So let's just do that.
205
00:12:18,040 --> 00:12:18,940
Go to our code editor.
206
00:12:19,720 --> 00:12:24,040
I'm going to add a CSS comment flag here so we know where we are.
207
00:12:25,720 --> 00:12:27,310
So the 3D button, you can do what you want.
208
00:12:27,310 --> 00:12:28,870
You could do a simpler comment if you want.
209
00:12:29,050 --> 00:12:29,980
This is what I like to do.
210
00:12:30,670 --> 00:12:33,460
Keeps it nice and easy to to organize and read.
211
00:12:33,730 --> 00:12:37,870
So what we're going to be doing now is we're going to be selecting 3D buttons here.
212
00:12:38,230 --> 00:12:40,480
We're going to be doing the button 3D one.
213
00:12:41,560 --> 00:12:42,730
I mean, if I go up here, actually.
214
00:12:43,890 --> 00:12:47,950
Button 3.1 and button 3.2, that's what are going to be selecting, so let's go ahead and select Button
215
00:12:47,950 --> 00:12:53,450
a 3D one and that is going to select that first 3D button.
216
00:12:53,470 --> 00:12:57,420
We're going to style that position relative important because we're going to be doing a little bit of
217
00:12:57,420 --> 00:12:58,050
movement.
218
00:12:59,010 --> 00:13:02,550
Background is going to be orange, red, nice and simple.
219
00:13:02,850 --> 00:13:11,880
No border color of the text is going to be white, patting me 15 pixels, 15 pixels top and bottom,
220
00:13:11,880 --> 00:13:15,470
24 pixels on the left and the right, the font size.
221
00:13:15,470 --> 00:13:21,660
We're going to be one point REM when you're using and it's relative to the parent element, whereas
222
00:13:21,660 --> 00:13:24,330
when you're using RAM, it's relative to the route, so just more consistent.
223
00:13:24,570 --> 00:13:31,190
It's a nice little measurement for CIUSSS three box shadow four.
224
00:13:31,600 --> 00:13:33,620
For this, we're going to do box shadow.
225
00:13:33,630 --> 00:13:37,650
We're going to say negative six pixels, six pixels, zero blobs.
226
00:13:37,650 --> 00:13:39,720
That's five pixels, zero.
227
00:13:39,720 --> 00:13:44,760
And then we're going to excel for hue saturation in little, whatever that is.
228
00:13:45,450 --> 00:13:47,250
HS also 16.
229
00:13:48,470 --> 00:13:50,870
One hundred percent and then 30 percent.
230
00:13:51,620 --> 00:13:54,170
16 is the Hue, 100 is the saturation.
231
00:13:54,350 --> 00:13:56,030
And then 30 percent is the lightness.
232
00:13:56,030 --> 00:14:02,990
So we want it to be this kind of like blood red sort of color for the shadow and then the outline,
233
00:14:02,990 --> 00:14:04,100
we want no outline.
234
00:14:04,490 --> 00:14:11,060
If I save that and we head over to our sandbox here, you can see we have the 3D button.
235
00:14:11,090 --> 00:14:12,230
It has the shadow over here.
236
00:14:12,410 --> 00:14:17,060
But the thing is, if I look at the final version it has, it has this kind of corner that connects
237
00:14:17,060 --> 00:14:17,480
the two.
238
00:14:17,780 --> 00:14:20,450
So while that looks pretty cool, I want it to be connected.
239
00:14:20,450 --> 00:14:25,640
So we're going to go ahead and work with that here in a moment.
240
00:14:25,850 --> 00:14:27,680
But before we do that, we might as well.
241
00:14:27,680 --> 00:14:36,650
While we're here, let's do the hover, the hover and active states button 3D one hover.
242
00:14:38,690 --> 00:14:44,270
We're going to do background is going to be SL 16, 100 percent and then 40 percent.
243
00:14:45,350 --> 00:14:47,210
I got these colors from Photoshop, by the way.
244
00:14:47,360 --> 00:14:49,760
If you're wondering, I'm not just pulling them out of the top of my head.
245
00:14:50,210 --> 00:14:54,370
Top pixels, the top three pixels left negative three pixels.
246
00:14:54,380 --> 00:14:58,940
This is why it was important to do position relative so that we could position the elements based on
247
00:14:59,390 --> 00:15:00,110
when we hover it.
248
00:15:00,620 --> 00:15:06,140
So and then the box shadow, we're going to change it a little bit to negative three pixels, three
249
00:15:06,140 --> 00:15:10,370
pixels, zero and then excel the same here.
250
00:15:13,350 --> 00:15:17,040
So what that's going to do is when you click it, let's or when you hover it, let's check it out,
251
00:15:17,640 --> 00:15:19,200
see how it pops down.
252
00:15:21,370 --> 00:15:22,010
That's pretty cool.
253
00:15:22,030 --> 00:15:24,940
Actually, I don't want that to do it on hover, I want that to do it on active.
254
00:15:25,180 --> 00:15:27,740
So that's going to actually be the active state.
255
00:15:28,070 --> 00:15:34,180
And now above this, I want to do the button, 3D hover button, 3D one hover.
256
00:15:35,710 --> 00:15:37,420
And that's going to be simple.
257
00:15:37,420 --> 00:15:43,990
We're just going to change the background to HL 16.
258
00:15:44,200 --> 00:15:46,870
One hundred and forty five for lightness.
259
00:15:46,870 --> 00:15:47,980
This can be a little bit lighter.
260
00:15:48,250 --> 00:15:49,090
So hover.
261
00:15:49,630 --> 00:15:51,730
It's actually it's actually a little bit darker.
262
00:15:51,730 --> 00:15:53,560
So there we go.
263
00:15:53,680 --> 00:15:56,140
And when we click, it moves that button down.
264
00:15:56,140 --> 00:15:57,670
So cool.
265
00:15:58,690 --> 00:16:00,880
Now, what we want to do is we want to give those corners.
266
00:16:01,450 --> 00:16:07,390
We want to add those little corners to connect these two, so it gives the illusion that they are one
267
00:16:08,200 --> 00:16:13,720
entire uniform box so we can do that by doing them before.
268
00:16:14,410 --> 00:16:15,240
Let me show you here.
269
00:16:15,250 --> 00:16:19,510
So we're going to do three button 3D one.
270
00:16:21,070 --> 00:16:28,540
And then to Collins, if we go before it's like a virtual, it's like a pseudo element of the here we
271
00:16:28,540 --> 00:16:28,700
go.
272
00:16:28,850 --> 00:16:31,240
It's a pseudo element that is the first child of the element matched.
273
00:16:31,450 --> 00:16:36,640
So it creates a pseudo element that it's not actually on in the markup, but it allows us to basically
274
00:16:36,640 --> 00:16:39,550
create an element of a thin air that's connected to this device.
275
00:16:39,940 --> 00:16:45,340
So what we're going to do is we're going to use that before pseudo element position in absolute.
276
00:16:45,580 --> 00:16:46,580
This is where the magic happens.
277
00:16:46,580 --> 00:16:50,010
It's pretty cool display block content.
278
00:16:50,020 --> 00:16:52,390
We need to do this in order for it to appear on the screen.
279
00:16:52,390 --> 00:16:55,270
It needs to have the content in an empty string.
280
00:16:55,390 --> 00:17:02,280
You can put text in there too if you want, which will do at some point height zero, width zero or
281
00:17:02,320 --> 00:17:06,570
we're going to be doing is creating a triangle and putting it in that corner there.
282
00:17:06,580 --> 00:17:09,620
So if I were to save this now, you're not going to see anything.
283
00:17:09,850 --> 00:17:14,740
So there's no point in showing you what we're going to do is create a border now.
284
00:17:15,670 --> 00:17:21,730
And let's see, this is going to be solid six pixels, transparent wolf does that word?
285
00:17:23,170 --> 00:17:24,070
Transparent.
286
00:17:24,850 --> 00:17:28,510
Now the border with needs to be the size of the elements box.
287
00:17:28,900 --> 00:17:29,530
Shadow.
288
00:17:30,930 --> 00:17:33,940
The box shadow here, you can see it here.
289
00:17:33,960 --> 00:17:41,880
So we have six pixels, so we have six pixels up here, so you'll see why in a moment and we're going
290
00:17:41,880 --> 00:17:43,110
to do border.
291
00:17:43,830 --> 00:17:46,050
What's border, right?
292
00:17:46,110 --> 00:17:48,120
Solid six pixels.
293
00:17:49,410 --> 00:17:52,270
We're going to do that color there.
294
00:17:52,740 --> 00:17:56,490
16, one hundred and thirty now.
295
00:17:57,870 --> 00:17:59,880
I'm going to say this, I'm going to show you over here in the browser.
296
00:18:00,090 --> 00:18:04,020
Look at this right here, you can see this little triangle that we made, do you see that?
297
00:18:04,920 --> 00:18:09,420
So it's just appearing here in the within the button so you can see what we've made so far.
298
00:18:09,420 --> 00:18:10,230
So we've made that.
299
00:18:10,500 --> 00:18:12,780
And what we want to do is.
300
00:18:13,760 --> 00:18:19,640
Basically, pull that up into the corner so we can use it, a section of it to give the illusion that
301
00:18:19,640 --> 00:18:24,380
there's a connection between that, between the button and its shadow.
302
00:18:24,800 --> 00:18:27,620
So let's go back here and our code editor.
303
00:18:29,030 --> 00:18:30,120
We're going to say border.
304
00:18:30,440 --> 00:18:33,080
Left with zero pixels.
305
00:18:33,080 --> 00:18:40,370
And what that's going to do is if we go back over here, all it's done is moved the element over about
306
00:18:40,370 --> 00:18:41,060
six pixels.
307
00:18:41,060 --> 00:18:44,240
So if I were to comment this out and save it.
308
00:18:44,450 --> 00:18:45,560
Now watch here in the browser.
309
00:18:45,560 --> 00:18:47,870
As I refresh, it's got moved it back over.
310
00:18:48,110 --> 00:18:50,540
It's just when I add zero was a border left width.
311
00:18:50,550 --> 00:18:52,760
It has no border here, so technically.
312
00:18:54,620 --> 00:19:01,040
The whole element is this big 12 pixels, but I want it to be just the six pixels right here, so I'm
313
00:19:01,040 --> 00:19:04,140
saying border left width or here in the code ED is zero.
314
00:19:04,160 --> 00:19:05,570
It just cleans it up a little bit.
315
00:19:05,570 --> 00:19:07,850
So it doesn't mess with my measurements when we move it.
316
00:19:09,460 --> 00:19:11,320
And background, none.
317
00:19:11,470 --> 00:19:14,290
Sometimes there's a background in the way I don't think I need to do that.
318
00:19:14,770 --> 00:19:19,720
Now what I'm going to do is say the top is zero pixels.
319
00:19:21,130 --> 00:19:23,560
That's going to push it over here in the browser to the top of the element.
320
00:19:23,830 --> 00:19:30,100
And now I need to push it over and fitted in right here like a puzzle piece like Tetris and the Left.
321
00:19:30,100 --> 00:19:32,020
If I were to say left zero.
322
00:19:33,190 --> 00:19:36,850
What that's going to do is just put it over here in the browser and put it to the left here.
323
00:19:37,030 --> 00:19:42,610
So I need it to be all the way over here and that if we know our math, when we set that element up,
324
00:19:42,610 --> 00:19:44,650
there is negative six or six pixels wide.
325
00:19:44,830 --> 00:19:46,510
So this needs to be negative six pixels.
326
00:19:46,510 --> 00:19:48,130
So the left needs to be negative six.
327
00:19:48,670 --> 00:19:51,340
If I say that, it's going to put it over there.
328
00:19:51,580 --> 00:19:52,540
Check out what just happened.
329
00:19:52,930 --> 00:19:59,050
A little bit of magic gives the illusion that that element is connected just by creating a little CSS3
330
00:19:59,050 --> 00:20:05,650
three triangle with borders and moving it with positioning into that corner right here to give the illusion
331
00:20:05,890 --> 00:20:06,160
just.
332
00:20:07,090 --> 00:20:07,710
This is cool.
333
00:20:08,500 --> 00:20:11,410
OK, so we're going to the same thing for that bottom right corner.
334
00:20:13,740 --> 00:20:18,210
But because we've already used the before pseudo element, we need to use the after pseudo elements,
335
00:20:18,210 --> 00:20:20,160
we have access to that as well.
336
00:20:20,370 --> 00:20:21,360
So I'm going to copy.
337
00:20:21,720 --> 00:20:24,540
I'm going to copy this because much of it is the same.
338
00:20:25,860 --> 00:20:29,290
And I'm all I'm going to do is paste it.
339
00:20:29,820 --> 00:20:31,230
Change it to after.
340
00:20:31,860 --> 00:20:38,370
But we need to change the position of certain parts of the elements so we can't just have it be the
341
00:20:38,370 --> 00:20:42,510
same because it's just going to show up in the same top left corner.
342
00:20:42,510 --> 00:20:43,710
So we need to change it a little bit.
343
00:20:45,000 --> 00:20:48,000
So it's actually me, I remove all of this right here.
344
00:20:49,170 --> 00:20:54,210
Except for the border, solid, transparent, what we're going to do now is going to say border top.
345
00:20:55,650 --> 00:21:01,110
It's going to be solid six pixels and then we have that cell, we're going to copy that color.
346
00:21:03,220 --> 00:21:08,710
Like so border bottom with groups.
347
00:21:11,510 --> 00:21:12,770
Is zero pixels.
348
00:21:13,840 --> 00:21:18,970
So now, if I say that, come over here and you could see all we're doing now is the border, you can
349
00:21:18,970 --> 00:21:19,270
see.
350
00:21:19,690 --> 00:21:21,100
Imagine this as a box.
351
00:21:21,430 --> 00:21:25,960
It's actually a whole box and I'm displaying only the top section of the border.
352
00:21:26,170 --> 00:21:29,050
So there's no there's no size for the box.
353
00:21:29,050 --> 00:21:32,320
There's nothing in the David or the height is zero in the width zero.
354
00:21:32,620 --> 00:21:35,200
But the border itself is six pixels wide.
355
00:21:35,410 --> 00:21:39,880
So we've got a six pixel border on all sides one two three four.
356
00:21:39,910 --> 00:21:40,810
This is the top.
357
00:21:41,170 --> 00:21:46,540
All I'm doing is hiding the left, right and the bottom borders and only showing the top border.
358
00:21:46,720 --> 00:21:48,640
So it has this triangle effect.
359
00:21:48,910 --> 00:21:51,370
So it's a cool little illusion that you could do in season three.
360
00:21:52,150 --> 00:21:57,760
So the the border top is six pixels in the border bottom is going to be zero.
361
00:21:58,000 --> 00:22:02,860
And the also you can see here the border transparent, all the borders are transparent.
362
00:22:03,130 --> 00:22:08,710
So if I were to remove the border top overwrite and then go back here in the browser refresh, you could
363
00:22:08,710 --> 00:22:12,550
see it's gone because the border is transparent but six pixels wide.
364
00:22:13,090 --> 00:22:19,330
But now, if I change the border top, which is the one I want to show to solid so we can see it six
365
00:22:19,330 --> 00:22:20,440
pixels and give it a colour.
366
00:22:20,560 --> 00:22:21,120
Save it.
367
00:22:21,130 --> 00:22:26,260
Now it's going to show and then the border bottom width and just making it zero so that it collapses.
368
00:22:26,260 --> 00:22:33,580
So it doesn't give us this messy 12 pixel box when all I need is six pixels.
369
00:22:33,760 --> 00:22:34,570
Does that make sense?
370
00:22:34,810 --> 00:22:35,470
I hope it does.
371
00:22:36,440 --> 00:22:42,000
It's it's quite simple and awesome, it's a pretty cool little concept to create the necessary triangles.
372
00:22:42,330 --> 00:22:43,890
OK, so we've done that.
373
00:22:43,920 --> 00:22:45,690
Now all we need to do is we need to move it.
374
00:22:45,720 --> 00:22:48,510
So the right is going to be zero, so it's all the way over to the right.
375
00:22:48,750 --> 00:22:52,380
So as you can see in the browser, if I were to save this, it's going to pop over.
376
00:22:52,380 --> 00:22:57,270
All I need to do now is move it down all the way to the bottom.
377
00:22:57,530 --> 00:22:58,880
So let's go here.
378
00:22:58,890 --> 00:23:02,730
We're going to go bottom negative six pixels in the browser.
379
00:23:03,930 --> 00:23:04,770
Pop over here.
380
00:23:04,950 --> 00:23:05,460
Look at that.
381
00:23:05,790 --> 00:23:08,040
It moved it over to the bottom.
382
00:23:08,050 --> 00:23:09,720
Now we have this effect that it's connected.
383
00:23:09,840 --> 00:23:10,710
It's quite magical.
384
00:23:10,920 --> 00:23:11,280
Cool.
385
00:23:11,910 --> 00:23:14,130
OK, now we have one little thing that we need to fix here.
386
00:23:14,130 --> 00:23:15,880
If I were to click on this, watch what happens.
387
00:23:15,900 --> 00:23:17,160
It's going to move the whole element.
388
00:23:17,430 --> 00:23:20,040
But now we can see our little triangles.
389
00:23:20,400 --> 00:23:21,390
So that's a problem.
390
00:23:21,630 --> 00:23:27,570
So what we need to do now is when we on the hover on the active states of the before and after pseudo
391
00:23:27,570 --> 00:23:32,190
elements, we need to shrink those triangles so that it still gives the effect to the illusion that
392
00:23:32,190 --> 00:23:33,030
it's a full box.
393
00:23:33,330 --> 00:23:34,530
So that's quite simple.
394
00:23:34,740 --> 00:23:37,290
All we need to do is add a couple extra things here.
395
00:23:38,130 --> 00:23:43,410
I'm going to say button 3D, one active and then before.
396
00:23:43,410 --> 00:23:48,540
So this means when it's active, I want to select the before pseudo elements and we're going to change
397
00:23:48,540 --> 00:23:54,120
the border to solid three pixels rather than six pixels because it needs to be the size of the border
398
00:23:54,120 --> 00:23:55,680
width transparent.
399
00:23:57,390 --> 00:23:57,890
Perfect.
400
00:23:58,170 --> 00:24:01,060
The border, right, is going to be solid three pixels.
401
00:24:01,080 --> 00:24:02,910
It's going to be that cell up here.
402
00:24:03,210 --> 00:24:10,530
Copying that, pasting that and then the border left width is going to be three zero pixels.
403
00:24:11,850 --> 00:24:16,380
Although I don't know if we necessarily need to do that, so I'm just going to remove that because I've
404
00:24:16,380 --> 00:24:21,690
already declared it and then left is going to be negative three pixels rather than negative six pixels
405
00:24:21,990 --> 00:24:23,770
if I save that and now watch this.
406
00:24:23,790 --> 00:24:24,720
The left side?
407
00:24:25,230 --> 00:24:26,370
Well, that doesn't look good at all.
408
00:24:27,820 --> 00:24:35,610
OK, something went weird there, maybe I do need to to declare the border left with to zero, let's
409
00:24:35,610 --> 00:24:36,390
see what that does.
410
00:24:38,280 --> 00:24:40,710
So I needed to do the border left with two zero for some reason.
411
00:24:41,490 --> 00:24:44,340
And now that looks good, but the bottom one doesn't look good.
412
00:24:44,340 --> 00:24:48,490
So let's just copy all this and then paste it below.
413
00:24:48,510 --> 00:24:51,300
We're going to change it to the after pseudo elements.
414
00:24:51,600 --> 00:24:54,120
Border is going to be solid three pixels.
415
00:24:54,420 --> 00:25:00,300
The border top is going to be solid three pixels and then the border bottom width is going to be zero.
416
00:25:01,170 --> 00:25:03,360
And then the bottom is going to be negative.
417
00:25:03,360 --> 00:25:03,720
Three.
418
00:25:03,990 --> 00:25:04,710
Save that.
419
00:25:04,710 --> 00:25:05,790
Check it out in the browser.
420
00:25:06,060 --> 00:25:11,310
Now we've got a perfectly working 3D button with all of the corners and the triangles working perfectly
421
00:25:11,310 --> 00:25:11,910
in sync.
422
00:25:12,510 --> 00:25:13,020
Awesome.
423
00:25:13,830 --> 00:25:14,790
That is beautiful.
424
00:25:14,880 --> 00:25:19,920
So now what we're going to do is we're going to create the Circle 3D button.
425
00:25:20,130 --> 00:25:20,700
Let's do that.
40138
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.