1
00:00:00,900 --> 00:00:06,140
It's time to flaunt your inner designer because we're about to learn some success.

2
00:00:07,140 --> 00:00:13,050
To start off, I want to show you this website, if you look at it well, it's it's quite, quite pretty.

3
00:00:15,360 --> 00:00:16,810
Look at that, that's really nice.

4
00:00:17,460 --> 00:00:22,530
Now, hopefully in the future, we can create something like this, but I want to show you what this

5
00:00:22,530 --> 00:00:24,960
website will look like without success.

6
00:00:27,480 --> 00:00:28,080
Here it is.

7
00:00:32,229 --> 00:00:37,780
Pretty impressive, right, with just success, you'll be able to create something like this.

8
00:00:39,110 --> 00:00:40,400
So let's get started to Shelly.

9
00:00:43,290 --> 00:00:48,540
I've created here for us a simple website, nothing that we haven't seen before.

10
00:00:48,570 --> 00:00:57,030
You can see that I have created semantic tags with heter nav, an unordered list that has some links,

11
00:00:57,690 --> 00:01:02,770
a PITA and a P tag that's wrapped in another semantic tag called section.

12
00:01:03,570 --> 00:01:05,820
OK, so again, nothing crazy.

13
00:01:05,820 --> 00:01:11,670
If I go to the Web page, it's the exact same thing except for the about Elai doesn't have an anchor

14
00:01:11,670 --> 00:01:13,470
tag and then same with login.

15
00:01:14,500 --> 00:01:23,150
OK, so let's talk about success, the way that we would add success to something like this is while

16
00:01:23,160 --> 00:01:25,540
we create a successful so let's do that.

17
00:01:25,810 --> 00:01:29,920
I'm going to create a new file that I'm going to save.

18
00:01:30,220 --> 00:01:33,550
Let's call it style dot success.

19
00:01:34,650 --> 00:01:42,480
If I save that, you'll see at the bottom over here that sublime text now has CSX as the file to.

20
00:01:43,840 --> 00:01:49,630
The rules with success are very simple, we essentially have a selecter.

21
00:01:51,240 --> 00:01:56,850
And then we have these squiggly brackets, and within it we put our property.

22
00:01:57,810 --> 00:02:04,560
Semicolon and then value, and then we have this special character as well at the end, and that is

23
00:02:04,560 --> 00:02:05,660
pretty much success.

24
00:02:05,730 --> 00:02:12,900
You know this you can write access just like a XML, just a couple of syntactic rules.

25
00:02:13,110 --> 00:02:15,980
And once you get used to it, it's very, very simple.

26
00:02:16,650 --> 00:02:19,370
But obviously this doesn't really mean anything.

27
00:02:19,380 --> 00:02:21,410
So let's write actual code here.

28
00:02:21,930 --> 00:02:27,090
I'm going to comment that out by again, doing command slash and sublime text.

29
00:02:27,090 --> 00:02:30,690
You can see that the commenting is different than in HTML.

30
00:02:31,230 --> 00:02:36,210
And let's say that we want to make this home text read.

31
00:02:36,510 --> 00:02:41,760
The way we would do it is we want to select what's called the selector.

32
00:02:42,420 --> 00:02:46,620
So here we want to say that the two we want that to be read.

33
00:02:47,040 --> 00:02:50,760
So all I would say is H to curly brackets.

34
00:02:50,760 --> 00:02:52,680
And then within here I want to say the property.

35
00:02:52,680 --> 00:02:56,580
I want to change the color to the value that is read.

36
00:02:58,050 --> 00:02:58,980
So if I save that.

37
00:03:00,390 --> 00:03:08,910
And refresh while nothing happens, and that's obvious, right, because how does this file know that

38
00:03:09,390 --> 00:03:10,400
this file exists?

39
00:03:10,740 --> 00:03:15,030
We have to link it somehow and we do that in the head.

40
00:03:15,030 --> 00:03:18,840
And we haven't talked too much about the hash tag element in the section.

41
00:03:19,260 --> 00:03:27,660
But by now, you can probably tell that head just contains information about what the page needs.

42
00:03:27,840 --> 00:03:35,850
Maybe not the stuff that we see on a Web page other than the title, but meta tags and information that

43
00:03:35,850 --> 00:03:37,320
we need for the website.

44
00:03:38,310 --> 00:03:48,870
OK, so in here, we can actually link to this stylesheet that we call style that comes with a link

45
00:03:48,870 --> 00:03:49,140
to.

46
00:03:50,170 --> 00:03:58,270
And this link tag allows us to link this ASML file to something else, and again, so biotech's has

47
00:03:58,270 --> 00:03:59,400
something very useful here.

48
00:03:59,410 --> 00:04:00,400
If I had tab.

49
00:04:01,450 --> 00:04:07,270
Look at that, it auto fills it for me, these are the standard attributes that you'll see to link to

50
00:04:07,270 --> 00:04:11,810
success, so you just have to get used to it and eventually you'll become second nature.

51
00:04:12,100 --> 00:04:16,300
So we have our yelle here, which is the adiabatic before relation.

52
00:04:16,300 --> 00:04:21,820
It just specifies what relationship this link will have and we'll have the default style sheet.

53
00:04:22,420 --> 00:04:24,940
And then for the type this is the media type.

54
00:04:25,240 --> 00:04:27,780
We want to say that it's a text file.

55
00:04:27,790 --> 00:04:32,890
We're essentially telling e-mail, hey, just a heads up we're linking to access file here.

56
00:04:33,220 --> 00:04:35,400
And the of this should be familiar.

57
00:04:35,410 --> 00:04:37,260
We're going to link to Starbucks.

58
00:04:37,750 --> 00:04:41,440
So if I type in style dot success.

59
00:04:43,260 --> 00:04:44,010
And save.

60
00:04:45,450 --> 00:04:46,290
Let's refresh.

61
00:04:47,710 --> 00:04:55,150
Turns red, and just to let you know, that index, that e-mail is in the same folder as style that

62
00:04:55,150 --> 00:05:00,660
says we can check it over here if I click on exercise, you see that?

63
00:05:00,790 --> 00:05:01,150
Yep.

64
00:05:01,240 --> 00:05:03,550
I have style that success with index.

65
00:05:05,280 --> 00:05:05,730
Perfect.

66
00:05:06,220 --> 00:05:12,510
OK, now what if we also want to make the paragraph over here, this Hypercolor as well?

67
00:05:13,050 --> 00:05:18,180
Well, again, we would do The Selecter and then we'll do Caulder and let's do pink.

68
00:05:19,060 --> 00:05:22,550
I save refresh and it's pink.

69
00:05:23,080 --> 00:05:24,010
Hopefully you can see that.

70
00:05:25,090 --> 00:05:30,520
You also see here that sublime text does some really nice coloring for us, so if I for example, I

71
00:05:30,520 --> 00:05:36,520
put a prop. that doesn't exist like a misspelled color, well, you see that it doesn't highlight it

72
00:05:36,520 --> 00:05:37,960
properly with the blue color.

73
00:05:38,110 --> 00:05:39,520
And you know that you've made a mistake.

74
00:05:39,520 --> 00:05:41,590
Again, another great feature of sublime text.

75
00:05:41,920 --> 00:05:45,130
So success, what does it actually stand for?

76
00:05:45,160 --> 00:05:49,960
Well, it stands for cascading style sheets and style sheets.

77
00:05:49,960 --> 00:05:52,240
That makes sense that we're creating style sheets.

78
00:05:52,250 --> 00:05:53,890
But what does cascading mean?

79
00:05:55,090 --> 00:06:02,110
Cascading means that it always takes the selecter, that is at the end.

80
00:06:03,160 --> 00:06:06,910
And that's simplified terms, but I want to demonstrate for you what that means.

81
00:06:07,390 --> 00:06:11,680
So let's say at the bottom over here, I do this again paragraph.

82
00:06:11,890 --> 00:06:14,260
I want color to be green.

83
00:06:15,220 --> 00:06:17,570
Well, if I save this, what do you think will happen?

84
00:06:17,620 --> 00:06:18,520
Let's refresh and see.

85
00:06:20,040 --> 00:06:22,230
It turns green and why is that?

86
00:06:22,260 --> 00:06:30,030
Well, because it's cascading, it's saying, OK, I'll set H two to read, OK, I'll set paragraph

87
00:06:30,300 --> 00:06:30,840
to pink.

88
00:06:31,950 --> 00:06:39,540
And then it says, OK, I'll set P to green so you can see here as it trickles down and cascades, it

89
00:06:39,540 --> 00:06:43,740
takes the last input that it receives for a specific selector.

90
00:06:44,700 --> 00:06:49,680
We'll get more into the cascading effects of success in a later video.

91
00:06:49,690 --> 00:06:53,980
But I want you to understand the basic concept around it, OK?

92
00:06:54,150 --> 00:06:58,350
I also wanted to show you something cool that you can do with Chrome, and we did this in the first

93
00:06:58,350 --> 00:07:01,710
couple of video series, but now you'll actually understand what I mean.

94
00:07:01,740 --> 00:07:05,240
So again, view developer developer tools.

95
00:07:05,550 --> 00:07:09,980
And from now on, I'll be using this shortcut to open it and you'll be able to do it as well.

96
00:07:11,890 --> 00:07:17,320
And if you remember, we have our stalled out, and if we click on the style tab, we have the team

97
00:07:17,340 --> 00:07:21,250
on the left stools over here and nothing for the styles.

98
00:07:21,790 --> 00:07:24,070
But if I now go into my.

99
00:07:25,210 --> 00:07:28,850
Home and I click on that, it'll show you color red.

100
00:07:29,680 --> 00:07:36,700
So Google Chrome, which allows us to see our access styles so I can even add stuff here and I could

101
00:07:36,700 --> 00:07:39,410
say background color.

102
00:07:40,350 --> 00:07:41,200
Let's do.

103
00:07:43,430 --> 00:07:43,890
Look at that.

104
00:07:44,360 --> 00:07:49,910
So this is a really good way to play with your website and add colors you can check and uncheck here.

105
00:07:50,150 --> 00:07:56,160
And also if you see something on a website that you really, really like, you can go to that element.

106
00:07:56,240 --> 00:07:57,720
Let's let's try it off here.

107
00:07:57,740 --> 00:07:58,700
Let's go to.

108
00:07:59,900 --> 00:08:02,900
Wait, but why dotcom?

109
00:08:04,670 --> 00:08:08,930
And let's say that we really, really want to know how.

110
00:08:10,010 --> 00:08:12,980
This was made we can right click.

111
00:08:14,120 --> 00:08:14,960
Do inspect.

112
00:08:16,550 --> 00:08:22,610
We'll take us exactly to that element and then we can see here some of the properties, the properties

113
00:08:22,610 --> 00:08:23,360
that they've used.

114
00:08:24,370 --> 00:08:28,450
And same here, you can see that the background color is this and so on and so forth.

115
00:08:29,630 --> 00:08:31,060
OK, let's close that for now.

116
00:08:32,470 --> 00:08:42,280
The last thing I want to leave you with is this close this what if I also want the above page to have

117
00:08:42,280 --> 00:08:42,669
stars?

118
00:08:42,970 --> 00:08:44,380
And same with the login page.

119
00:08:44,380 --> 00:08:50,440
As you can see, there's no style for these ones, but we want the same thing for the about and login

120
00:08:50,440 --> 00:08:50,770
page.

121
00:08:51,400 --> 00:08:54,460
Well, as you can imagine, we copy the link tag.

122
00:08:55,740 --> 00:08:57,240
And we go to about.

123
00:08:58,430 --> 00:09:04,250
We link it on to here and then log in, we can again link it here.

124
00:09:04,280 --> 00:09:10,880
I save both of these files and now if I refresh and go to about look at that.

125
00:09:11,180 --> 00:09:12,080
We have our styles.

126
00:09:13,210 --> 00:09:17,920
And you may be wondering, well, what if I want different styles for maybe for the logging, I want

127
00:09:17,920 --> 00:09:18,950
this to be blue instead?

128
00:09:19,660 --> 00:09:22,630
Well, we can actually create multiple style sheets.

129
00:09:22,780 --> 00:09:31,080
So I can say, for example, let's create a new file and we'll call it style to success.

130
00:09:31,720 --> 00:09:32,590
I say that.

131
00:09:32,920 --> 00:09:37,300
And this time I'm going to say that I want my to.

132
00:09:38,220 --> 00:09:39,240
To have color.

133
00:09:41,220 --> 00:09:51,420
I say that I go into my login e-mail and now I'll make login reference the second stylesheet instead

134
00:09:51,420 --> 00:09:52,050
of the first one.

135
00:09:52,920 --> 00:09:54,510
So now if I refresh.

136
00:09:55,790 --> 00:10:04,340
Log-in is referencing our style to excess, but all the other ones are still referencing the old one.

137
00:10:04,550 --> 00:10:11,390
OK, Ally, there is one last thing that I want to add, and that is that this is the common way of

138
00:10:11,390 --> 00:10:12,410
adding styles.

139
00:10:12,830 --> 00:10:18,260
But there is actually two other ways that you won't see us often, especially when you're starting off.

140
00:10:18,590 --> 00:10:21,650
But I wanted to show it to you so that you're not surprised.

141
00:10:22,740 --> 00:10:29,520
The first way of doing it is something called inline styles, and this was the original way that we

142
00:10:29,520 --> 00:10:36,810
incorporate as styles into our e-mail, and that is by specifying within the element, let's say let's

143
00:10:36,810 --> 00:10:38,110
go with head over here.

144
00:10:39,030 --> 00:10:41,970
We want to say style so it has a style attribute.

145
00:10:42,810 --> 00:10:48,030
And then within here we can do the background color.

146
00:10:50,080 --> 00:10:55,720
Let's do green and refresh, and we're at the about page right now, we change that for index that I

147
00:10:55,720 --> 00:10:55,990
assume.

148
00:10:55,990 --> 00:10:58,300
Also, let's go over here and look at that.

149
00:10:58,330 --> 00:10:59,560
We have the green background.

150
00:11:00,400 --> 00:11:05,410
And if you want to add more, again, we do color red.

151
00:11:05,740 --> 00:11:09,130
Let's save and refresh and look at that.

152
00:11:09,880 --> 00:11:12,130
The header has the color red.

153
00:11:12,130 --> 00:11:17,290
And you'll see here that these ones are still purple because they are linked tags and they have the

154
00:11:17,290 --> 00:11:18,280
default linking.

155
00:11:18,730 --> 00:11:21,070
OK, so that's one way.

156
00:11:21,880 --> 00:11:25,660
And third and last way is in the head.

157
00:11:25,660 --> 00:11:30,790
You can actually create Celltex and then within these style tags.

158
00:11:32,140 --> 00:11:37,720
You can enter CCWs, so if you just refresh here, so we have a fresh, clean slate.

159
00:11:37,900 --> 00:11:41,260
I can now say Sue Elai this time.

160
00:11:41,260 --> 00:11:50,170
So all the lists I want the lists to have background color of purple.

161
00:11:51,580 --> 00:11:58,080
So if how save this and refresh everything is purple and that looks pretty yucky.

162
00:11:58,150 --> 00:12:03,670
You can keep adding stuff on here and I can say color white, save refresh.

163
00:12:04,000 --> 00:12:06,220
And it changed the color to white.

164
00:12:07,510 --> 00:12:13,450
Now, you may be wondering, why don't we just do it like this, this seems a lot simpler than linking

165
00:12:13,450 --> 00:12:15,010
to another file.

166
00:12:15,940 --> 00:12:21,550
Well, the reason is that for this website, everything is fairly small, is just a couple of lines

167
00:12:21,550 --> 00:12:22,150
of success.

168
00:12:22,150 --> 00:12:27,010
But you can imagine with websites, as they get bigger and bigger, you'll have hundreds and hundreds

169
00:12:27,010 --> 00:12:28,540
of lines of success.

170
00:12:28,660 --> 00:12:33,280
And having one massive file will be very, very challenging to maintain.

171
00:12:33,880 --> 00:12:40,450
You can also think of it as if you were working on an e-mail and you also had a team of designers that

172
00:12:40,450 --> 00:12:42,250
were working on a case file.

173
00:12:42,550 --> 00:12:49,510
You want to have a separation where you have some team members working on the success and then some

174
00:12:49,510 --> 00:12:52,170
team members working on the e-mail.

175
00:12:52,510 --> 00:12:55,720
And that is a concept called separation of concerns.

176
00:12:55,720 --> 00:13:00,390
And it's a fancy way of saying that everybody just worry about what they're good at.

177
00:13:00,730 --> 00:13:07,360
So ASML just worry about text and CSFs just worry about Stiles.

178
00:13:07,690 --> 00:13:13,060
This phrase separation of concerns is something that will encounter throughout later videos when we

179
00:13:13,060 --> 00:13:14,980
get into JavaScript and react.

180
00:13:14,980 --> 00:13:20,950
And it's a very, very important concept and web development and computer science in general.

181
00:13:20,950 --> 00:13:22,500
So we will get back to that.

182
00:13:22,520 --> 00:13:24,720
It'll be a phrase that will keep coming up.

183
00:13:25,270 --> 00:13:25,990
So for now.

184
00:13:27,270 --> 00:13:33,690
Let's delete this, let's keep things the way that we have it, let's refresh and in the next video,

185
00:13:33,720 --> 00:13:39,810
I'm going to show you a couple of excess properties that are more exciting than just color and background.

186
00:13:40,320 --> 00:13:42,060
I've seen that one by.

