How to make a horizontal line responsive?

Asked

Viewed 28,028 times

2

I cannot simply make a line, because depending on the page, instead of a line, it generates continuation in another line.

2 answers

3

You could use the tag <hr /> or the border-bottom in a div

#linha {
  width: 100%;
  border-bottom: 1px solid #000000;
}
<div id="linha">
  conteudo da div
</div>

<div>
  conteudo da div
</div>

<hr />

<div>
  conteudo da div
</div>

  • Thank you for the reply.

2


Wouldn’t it be better to use the HR to do this?

hr{
  border-color:#aaa;
  box-sizing:border-box;
  width:100%;  
}
<hr/>

If necessary, just format it the way you want, so that it will look amazing underline. You can also use Width: 100% to ensure it’s responsive.

  • Thank you solved what I needed.

  • 1

    Helped me a lot too, thank you!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.