Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Regular Coder
    Join Date
    Mar 2011
    Posts
    164
    Thanks
    7
    Thanked 0 Times in 0 Posts

    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

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    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

  • #3
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,235
    Thanks
    10
    Thanked 270 Times in 269 Posts
    Install the Firebug add-on to Firefox. It makes looking at such things simple.

    Dave

  • #4
    Regular Coder
    Join Date
    Mar 2011
    Posts
    164
    Thanks
    7
    Thanked 0 Times in 0 Posts
    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!

  • #5
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts

    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

  • #6
    Regular Coder
    Join Date
    Mar 2011
    Posts
    164
    Thanks
    7
    Thanked 0 Times in 0 Posts
    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?

  • #7
    Regular Coder
    Join Date
    Aug 2011
    Location
    U.S.A.
    Posts
    233
    Thanks
    2
    Thanked 48 Times in 48 Posts
    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.

  • #8
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    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

  • #9
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,642
    Thanks
    6
    Thanked 1,005 Times in 978 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •