Infigon
Infigon

Reputation: 672

<br> not collapsing with visibility:collapse

For some strange reason, visibility:collapse does not collapse the <br> (new line) element

I want to use visibility instead of display. I realize that there are a lot of options for visibility, and there could be an alternative. How can I achieve this?

a<span style=visibility:collapse><br>invisible text<br><br></span>a
<br><br>
b<span style=display:none><br>invisible text<br><br></span>b

Upvotes: 0

Views: 190

Answers (1)

Pointy
Pointy

Reputation: 413737

The "collapse" mode works just like "hidden" most of the time. The content is not shown (your "invisible text") but the element still affects the layout as if it were.

That mode is most useful for table rows and flex items.

Upvotes: 1

Related Questions