Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-09-2012, 11:38 PM   PM User | #1
listerdl
Regular Coder

 
Join Date: Mar 2011
Posts: 157
Thanks: 7
Thanked 0 Times in 0 Posts
listerdl is an unknown quantity at this point
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
listerdl is offline   Reply With Quote
Old 12-09-2012, 11:44 PM   PM User | #2
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
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.
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Old 12-09-2012, 11:47 PM   PM User | #3
tracknut
Regular Coder

 
Join Date: Aug 2006
Posts: 892
Thanks: 4
Thanked 206 Times in 205 Posts
tracknut is an unknown quantity at this point
Install the Firebug add-on to Firefox. It makes looking at such things simple.

Dave
tracknut is offline   Reply With Quote
Old 12-10-2012, 12:07 AM   PM User | #4
listerdl
Regular Coder

 
Join Date: Mar 2011
Posts: 157
Thanks: 7
Thanked 0 Times in 0 Posts
listerdl is an unknown quantity at this point
Quote:
Originally Posted by Excavator View Post
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!
listerdl is offline   Reply With Quote
Old 12-10-2012, 12:09 AM   PM User | #5
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
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/
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Old 12-10-2012, 12:11 AM   PM User | #6
listerdl
Regular Coder

 
Join Date: Mar 2011
Posts: 157
Thanks: 7
Thanked 0 Times in 0 Posts
listerdl is an unknown quantity at this point
Quote:
Originally Posted by tracknut View Post
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?
listerdl is offline   Reply With Quote
Old 12-10-2012, 12:20 AM   PM User | #7
resdog
Regular Coder

 
Join Date: Aug 2011
Location: U.S.A.
Posts: 233
Thanks: 2
Thanked 48 Times in 48 Posts
resdog is on a distinguished road
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.
__________________
WordPress Designer and theme developer. KlongDesigns - helping bloggers and non-technical folks claim their space on the internet.
resdog is offline   Reply With Quote
Old 12-10-2012, 12:30 AM   PM User | #8
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Quote:
Originally Posted by listerdl View Post

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;}
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Old 12-10-2012, 12:23 PM   PM User | #9
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,614
Thanks: 5
Thanked 865 Times in 842 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
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.
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:06 AM.


Advertisement
Log in to turn off these ads.