Loading ...
Sorry, an error occurred while loading the content.

Re: [NH] Re: margins for paragraphs

Expand Messages
  • Axel Berger
    ... I forgot I wrote the following only to Don: I am currently using padding in the container and setting margins to zero for all inside that container -
    Message 1 of 4 , Sep 30, 2007
    • 0 Attachment
      Cary wrote:
      >
      > I'll admit I'm having trouble following this, but you might use
      > padding on the div to create space between it and the paragraph it
      > contains rather than using a margin on the paragraph.

      I forgot I wrote the following only to Don:


      I am currently using padding in the container and setting margins to
      zero for all <P> inside that container - but what if there's more than
      one paragraph? All in all this is very unsatisfactory. This problem is
      also solved by placing a border around the container and having the
      paragraph margin push against that, but again this is not always
      feasable.

      > So for you example code you gave you could use this styling:

      You are absolutely right! What must have happenened (again!) when I
      tried that first was some silly typo and I had to take away the
      paragraph margins altogether.
      I have now found two more things:
      1) Doing it exactly your way the outer margins inside the light DIVs get
      somewhat bigger than I'd like them.
      2) Even I very small nominal padding of just one pixel does the trick
      and everything looks perfect.

      Oh for the syntax error messages in compilers that don't let typos slip
      by so easily!

      Axel
    • buralex@gmail.com
      Axel Berger said on Sep 30, 2007 3:41 -0400 (in ... Isn t that why God invented HTML-tidy :-) Regards ... Alec -- buralex-gmail --
      Message 2 of 4 , Sep 30, 2007
      • 0 Attachment
        Axel Berger <Axel-Berger@...> said on Sep 30, 2007 3:41 -0400 (in
        part):
        > Oh for the syntax error messages in compilers that don't let typos slip
        > by so easily!
        Isn't that why God invented HTML-tidy :-)

        Regards ... Alec -- buralex-gmail
        --



        [Non-text portions of this message have been removed]
      • Corl DeLuna
        Hi Axel, I ve been using the Global White Space Reset technique for a long time now
        Message 3 of 4 , Sep 30, 2007
        • 0 Attachment
          Hi Axel,

          I've been using the Global White Space Reset technique for a long time now
          <blocked::http://leftjustified.net/journal/2004/10/19/global-ws-reset/>
          http://leftjustified.net/journal/2004/10/19/global-ws-reset/ taking almost
          all of the guess work out of why my explicit margins aren't behaving. It's
          very easy to implement.

          * { /*global reset*/
          padding: 0;
          margin: 0;
          }

          I don't set any margins for my paragraphs, instead I let them inherit the
          parent div margins. This prevents the confusion of the margins of one
          element adding to another.

          For my own sanity, I explicitly state all four directions in each margin,
          even when 0:

          li{
          line-height: 1.4em;
          margin: 0 0 .7em 0;
          }

          I'm looking at adopting the YUI Reset CSS technique
          http://developer.yahoo.com/yui/reset/
          <blocked::http://developer.yahoo.com/yui/reset/> to create a level playing
          field across most browsers.

          Hope this helps some.
          Corl


          _____

          From: ntb-html@yahoogroups.com [mailto:ntb-html@yahoogroups.com] On Behalf
          Of Axel Berger
          Sent: Sunday, September 30, 2007 12:41 AM
          To: ntb-html@yahoogroups.com
          Subject: Re: [NH] Re: margins for paragraphs



          Cary wrote:
          >
          > I'll admit I'm having trouble following this, but you might use
          > padding on the div to create space between it and the paragraph it
          > contains rather than using a margin on the paragraph.

          I forgot I wrote the following only to Don:

          I am currently using padding in the container and setting margins to
          zero for all <P> inside that container - but what if there's more than
          one paragraph? All in all this is very unsatisfactory. This problem is
          also solved by placing a border around the container and having the
          paragraph margin push against that, but again this is not always
          feasable.

          > So for you example code you gave you could use this styling:

          You are absolutely right! What must have happenened (again!) when I
          tried that first was some silly typo and I had to take away the
          paragraph margins altogether.
          I have now found two more things:
          1) Doing it exactly your way the outer margins inside the light DIVs get
          somewhat bigger than I'd like them.
          2) Even I very small nominal padding of just one pixel does the trick
          and everything looks perfect.

          Oh for the syntax error messages in compilers that don't let typos slip
          by so easily!

          Axel





          [Non-text portions of this message have been removed]
        • sisterscape
          ... I haven t been following this thread but yes, this reset technique is necessary to put all browsers on a level playing field with regard to margins and
          Message 4 of 4 , Sep 30, 2007
          • 0 Attachment
            --- Corl DeLuna <corl@...> wrote:
            >
            > I've been using the Global White Space Reset technique for a long
            > time now
            >
            > * { /*global reset*/
            > padding: 0;
            > margin: 0;
            > }
            >

            I haven't been following this thread but yes, this reset technique is
            necessary to put all browsers on a level playing field with regard to
            margins and padding. Once that's included in your stylesheet, you
            should be able to specify your own margins/padding without interference
            from browser interpretation.





            ____________________________________________________________________________________
            Need a vacation? Get great deals
            to amazing places on Yahoo! Travel.
            http://travel.yahoo.com/
          Your message has been successfully submitted and would be delivered to recipients shortly.