Ask coding questions

← Back to all posts
How do I make the border around the first three lines?
JemmaPatel (1)

I would like to have my border around the first three lines written on my website and nothing else/not the whole page and I am not sure how to do so, can someone help?

Coder100 (16800)

Hi! You could make a class:

.border {
  border: brown;

and then inside the elements you want to have the border,

<header class="border">
  has border
<main class="border">
  text here
  doesn't have border

Add a <div></div> tag around the part that you want bordered and then set a border in CSS.

JemmaPatel (1)

@GoofyGus I tried that, is there something wrong with the placement of my border code in css?