Talking to one line at a time
In the last lesson we discovered how to manipulate the way borders look like. In this lesson we go deeper into defining CSS border rules as we discover how we can manipulate one border line at a time.
Video Transcript
00:00Now that we got out of the way the differences between outlines and borders
00:04It's time for us to take a deeper look into borders because with borders we could even manipulate one
00:11region at a time
00:12So by then this lecture you will know how to change the way a border element looks like for example your bottom area of your border
00:19So let's see it in action
00:22At least at this stage one of the things that we're going to do now that is explicitly borders
00:27Just does not exist for outlines
00:30Now borders contrary to outlines
00:32I could literally go ahead and define borders to specific elements of a border if it's the top position
00:39The bottom the left or the right so let's see it first in action
00:43So I'm going to go ahead there and just ask for the border
00:46top and
00:47By setting the border top that's really all I needed to define the rules for that element and the same exact rules apply
00:55I set the color that I want it to be in I set the type for example
01:00I want it to be dotted and I want it to be two pixels now literally
01:04I'm creating a differentiation here, and the order is very critical so in this case once I set the border now
01:10I'm
01:11Overriding the top with new rules
01:13And if I go ahead here and save this go back into my browser and click on refresh notice how the border itself has an
01:21Completely different top area than it was one what it was before it's been overridden
01:29Notice the dash lines right here the red dash lines now
01:33Contrary to that what I will not only contrary to that as you might guess and you might not guess is that I could also
01:40control only
01:41Specificalities so for example if I wanted to control only the width or I wanted to control only a
01:47The style or only the color I could go ahead and set to my border
01:53top
01:54The style that I want it to be so for example if I wanted the style actually not to be dotted but to be let's say
02:00Let's look at the list of items. I have here. I want to make it double
02:05So I could go ahead and set it to be double. I could also go ahead to my border top and
02:12Let's say I want to also change the width and I wanted the width to actually be six pixels
02:19notice again, what's actually happening here is
02:22Original item that we had here that was red is transferred into us, but we're overriding it to be dotted and two pixels
02:30So for example if I change it to be blue all right, so I'm overriding it by the way
02:34I didn't have to put anything if it was red
02:36I didn't have to set it, but I'm gonna go ahead
02:38I'm gonna set it to blue to change it to be blue dotted and two pixels
02:42But beyond that now I'm overriding it again, and I'm overriding the style turning it to be a double style
02:48I'm overriding the width making it six pixels and again if I wanted to I could have gone to that border
02:55top and set also the color to be a completely different color of my choosing such as
03:02green
03:03I'm gonna go ahead here and save it and
03:06Refresh my screen and now I should expect to see a bold
03:10six pixel
03:11Green line, which is exactly what I'm saying, and it is very disturbing that color
03:16And I'm gonna just go right back in here to just talk about one more thing
03:21So we're really gonna cover 16 different tags right now. We talked about top we talked about how the top could have
03:27Subsidiaries as well same goes for bottom left and right so I'm not gonna do it
03:32I'm just gonna put here just as a reminder that you could auto configure auto
03:36Bottom left and right with all those color mixes with all those combinations of
03:42Settings based on the item that you want to set so I'm gonna just go ahead here and just comment it out
03:47But I'm also gonna make sure that you have your that
03:50Combinations so you could remember that you have all these different combinations that you create you could create of width style and
03:58Color and that's it this covers this title and this color covers really this chapter
04:04Where we've seen in in essence the differences between outlines and borders, and we've seen now also things very specifically unique to borders
04:13Beyond that borders are also very relevant when it comes to tables
04:17But as this title does not cover tables and in our future CSS course we're gonna get into tables then just as a side note
04:25We're gonna also talk about borders again once we talk about tables in general so there we go
04:31And this covers this chapter, so we'll see you in the next chapter
