Adding a Horizontal Rule
Everyone. Nice, Simple one. We've got no line now we've got a line. Super simple. We're going to add a border to the box of the heading. We'll talk about the HR tag as well. Let's jump into venus code and make it happen. All right. First up, let's talk about the line we need. Is this one here? Right? So my mock up, I've got this line that runs across the document. Okay. Up the top head kind of like between the header and this main hero box here. So, and it's kind of like a light gray. Like I've picked that color there. C C C C C. And let's show you how to do it. So the bad way. Okay, well it's not a bad way. It just doesn't seem to use that much very often and it has some drawbacks. So between the header and the main, I'm just gonna stick it right here in the middle. Okay. And we're going to use this tag if you've done any of my previous courses, this HR tag is what we use the horizontal rule. Okay. And it appears on the page. It's perfect. It's got a lot of styling on it, which is pro...
bably the biggest problem with it. Weirdly about an HR tag as well. It doesn't have a closing HR doesn't need it. Okay. I don't know why. It just just magic. Doesn't need to do that whole thing. There's a couple of tags that do that. Um, so the reason we don't do that is in the html five documentation. It says, hey, we're not using this anymore as a ruler. Were using it as a, like a content break and we're going to hide it. You should make it so it's styled so you can't see it and it's used to break up content still still works, but let's just not use it anymore. And I'll show you the easiest way to get around it super easy. So in our case because the other drawback with HR, it's something on your page and I'm going to have to have this on every single page. Okay, underneath every hitter. Okay, so a nice way to get around it is either we're gonna add a border like we did for the buttons here on the bottom of either the header or the top of the main. Either way will get us to the right place. Let's find the header. Okay. That's kind of weird. Okay, and you'll notice how the bracket was there. It's not broken. It's just, it annoys me. Okay. I like it to be separated out like that. Okay, so we're going to use um border, it's about it right today? Border bottom. Okay. And just like we did before we can put a kind of a row. So the first one is how white it is and then it's going to be solid and then it's going to be gray. I love this. You can use gray with an A or an E. It's the same color. I don't think there's even american or english versions of the spelling. I think just there's two spellings of the same word. I'm probably wrong about that. But anyway, there you go. I've got this. Okay, there is a light gray for both of those. Both spelt the same. Okay, you can have both the spellings, you can see it's doing the exact same job and it's just a more simple thing. Okay. Whereas the other one had all this kind of really weird depth to it. Okay, the HR has some weird styling to it, kind of old school. Okay. You've got solid, you've got dotted. There's lots of different stylings for it. That styling is pretty small. Make it nice and big so you can see it in case you want giant dots, but that's it. Nice. Short video. Easy to do lines don't use the HR anymore. Just find one of the boxes that applies. Now there are going to be times where you're like actually I want a small little line across and you might use the HR. You might just style it to get rid of all the extra bits. I'm not going to cover, how to remove all the kind of built on styling for it. You might find that yours is actually a nice straight line using the HR because the CSS reset you're using might have cleared it up but the one we're using from chris. Mayer is not alright, that's it. I'll see you in the next video