<p> and <br> line spacing

Hi

With css how do I change the default line spacing for the <p> and <br> tags

Many thanks
kenabbottAsked:
Who is Participating?
 
Eternal_StudentConnect With a Mentor Commented:
p{line-height:14px}
0
 
Eternal_StudentCommented:
or

br {line-height:8px}
0
 
kenabbottAuthor Commented:
So what are the default settings for the 2 tags?
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
Eternal_StudentCommented:
Im not sure about that [good question] but I do know that IE and FF can set them differently, more so the br tag because it also depends on the font-size, family, etc.
0
 
TheKyleCommented:
"So what are the default settings for the 2 tags?"

All browsers have different default settings for each element.
0
 
kenabbottAuthor Commented:
Yes I appreciate the differnces with different browsers, I was just curious what the the defaults were for IE and FF for examples
0
 
Eternal_StudentCommented:
The line-height property will accept a value to control the spacing between baselines of text. ... Percentage values are relative to the element's font size.

With that said i don't think paragraph line-height will be different between IE and FF if it is not set. But the <br/> tag certainly is a different height just like inconsistencies between margins on form elements. So playing with the line-height value is one way of causing both browsers to behave the same way.

This is usually the very first line I use on my stylesheet:

*{margin:0; padding:0}

That ^ will select everything and set its' default margin and padding to zero so both browsers are equal. The only other inconsistencies I run into are usually genuine bugs or line-height issues to with padding/margin calculations [especially on complex menus or form buttons].
0
 
TheKyleCommented:
You'd probably have to ask someone that works for Microsoft or Mozilla to find out what the default is.  Of course, you could download the Mozilla source code and find out what Firefox's default is on your own, but I don't think you want to do that. ;)

It's possible that IE and FF use the same default line-height, but not guaranteed.  Unfortunately I don't know what they are.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.