Make the <div> tag behave like a tag with a CSS tag

Is it possible to create a <div> tag as a stock <br> tag with CSS?

Are there any other tags that cannot be simulated by styling a <div> ?

+4
source share
3 answers

add style clear:both;

+6
source

Yes, you can have a div to do anything if you know exactly what properties it should be assigned to.

For the fake tag "br" (although I'm not sure why you need this) you can set:

 .classname { height: 10px; width:100%; display:block; position:relative; } 
+1
source

I'm not quite sure that I understand the question, “behave like a <br /> . You can define the display attribute of both.

 display: inline | block; 

This will detect line breaks before and after any element.

0
source

All Articles