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

4961Re: [NH] Tell me again...

Expand Messages
  • Marcelo de Castro Bastos
    Jan 13, 2005
      On 13/1/2005 23:43, Christine invited the wrath of the gods by saying:

      >Ok...
      >Since I always use CSS, this is simply something to use other than <P
      >class=xxx">, which would also not add the paragraph spacing after..
      >
      >
      >
      Not quite.
      First, you will probably need to use classes and IDs anyway with <div>
      and <span>. But it may be far more economical, not to mention easier to
      debug, say, to do this:

      <style>
      div.yellowtext p {color:yellow}
      </style>
      .
      .
      .
      <div class="yellowtext">
      <p>lorem ipsum</p>
      <p>lorem ipsum</p>
      <p>lorem ipsum</p>
      </div>

      instead of this:

      <style>
      p.yellowtext {color:yellow}
      </style>
      .
      .
      .
      <p class="yellowtext">lorem ipsum</p>
      <p class="yellowtext">lorem ipsum</p>
      <p class="yellowtext">lorem ipsum</p>

      With the advantage that you can do additional block-leval formatting
      (say, giving this whole part of the page a different background color,
      and an overall border) by styling the div.yellowtext selector.


      Then, the paragraph elements (<p> and <h1>...<h6>) are somewhat special,
      in that although they are block elements, they cannot contain other
      block elements. So they are useful as "lowest level" block elements.

      Divs are more useful for multi-paragraph blocks of text, or to do layout
      stuff that in the past had to be done with tables.

      Anyway, you can easily get rid of the "paragraph spacing after" you
      mention by styling. For instance, I like styling long pieces of text
      (especially if they are intended for printing) in this way:

      p {text-align:justify;
      text-indent:3em;
      margin-bottom: 0.1em;}

      Marcelo
      -=-=-
      ... All in all just another brick in the wall.
      * TagZilla 0.057
    • Show all 25 messages in this topic