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?

Comments
hotnewtop
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
</header>
<main class="border">
  text here
</main>
<footer>
  doesn't have border
</footer>
[deleted]

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?