![]() |
Why no line break when I open/ close <p>
This is odd....
I just have a simple paragraph <p>text</p> then when I start a new paragraph there is no line break.... My suspicions is that there is an "inline:block" or something like that which makes the markup NOT do linebreaks... Any suspicious what I need to look for with this? Thanks |
Hello listerdl,
Are you using a CSS reset? Something like * {margin: 0; padding: 0;} would remove defaults set on the p tag that do what you're missing. |
Install the Firebug add-on to Firefox. It makes looking at such things simple.
Dave |
Quote:
Top of the css is this Code:
* { margin: 0; padding: 0; outline: 0; }Thanks! |
Quote:
Here's why - http://meiert.com/en/blog/20080419/r...heets-are-bad/ |
Quote:
Can you think of a way to allow my <p></p> to behave as they are meant to - i.e. like paragraphs that actually have a line break? I guess i could make a paragraph class but that just seems a long way around the problem? |
You can remove any css that changes your <p> tags. The line in your code will apply to ALL elements on your site.
The problem with resets is that browsers render default margins and paddings, which can be a good thing (to have control of it), but if you want your p tags to have the default behavior, you need to delete that * css call. |
Quote:
p {margin: 16px 0;} |
The margin doesn’t have anything to do with line breaks, though. A line break can (and should) also occur without any top and bottom margin. But really, Firebug (or similar debugging tools) make it easy to find which style setting is influencing the paragraphs to not cause line breaks.
|
| All times are GMT +1. The time now is 11:56 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.