CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   HTML & CSS (http://www.codingforums.com/forumdisplay.php?f=13)
-   -   Why no line break when I open/ close <p> (http://www.codingforums.com/showthread.php?t=283867)

listerdl 12-09-2012 11:38 PM

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

Excavator 12-09-2012 11:44 PM

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.

tracknut 12-09-2012 11:47 PM

Install the Firebug add-on to Firefox. It makes looking at such things simple.

Dave

listerdl 12-10-2012 12:07 AM

Quote:

Originally Posted by Excavator (Post 1298595)
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.

Hey! Absolutely right -

Top of the css is this

Code:

* { margin: 0; padding: 0; outline: 0; }
What should i do? remove this line?

Thanks!

Excavator 12-10-2012 12:09 AM

Quote:


Code:

* { margin: 0; padding: 0; outline: 0; }
What should i do? remove this line?

Thanks!
I would say remove it, yes. You will likely need to re-adjust many of your elements that take on their defaults again though.

Here's why - http://meiert.com/en/blog/20080419/r...heets-are-bad/

listerdl 12-10-2012 12:11 AM

Quote:

Originally Posted by tracknut (Post 1298596)
Install the Firebug add-on to Firefox. It makes looking at such things simple.

Dave

Yeah thanks - in fact i just recently installed that - i need to start using it more.

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?

resdog 12-10-2012 12:20 AM

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.

Excavator 12-10-2012 12:30 AM

Quote:

Originally Posted by listerdl (Post 1298603)

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?

p {margin: 16px 0;}

VIPStephan 12-10-2012 12:23 PM

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.