I want to style my <BR>
elements to have margins more like <P>
elements. How can I do that?
views:
85answers:
5hasn't any effect in my doc
lovespring
2010-08-01 07:24:57
+1
A:
You can specify any style to almost any element using CSS.
Default margin for P element is 1em 0; So, your CSS code should look like this:
br {
margin: 1em 0;
}
If you need to see default or current style properties for any element, you can use Firefox with Firebug or Chome/Safari/Opera Developer Tools.
Māris Kiseļovs
2010-08-01 05:37:05
A:
You can use line-height
. You have to have two <br />
, first to break line and second to add range between lines.
Jeaffrey Gilbert
2010-08-01 06:16:43
A:
Not sure why boogyman's answer has -2, but that's correct. To do what you're asking, try
<p> </p>
That will break the line and still give you the margin.
Adam Tootle
2010-08-01 06:58:32
A:
If you have to use <br>
then you can use this:
<br></br> <!-- you MUST have the closing tag -->
And css:
br {
margin: 1em;
}
box9
2010-08-01 15:06:31