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

2357Re: CSS QUERIE

Expand Messages
  • john041650
    Feb 2, 2002
      Hi Artis,

      I used to use class tags in my individual TD elements, but changed
      to using DIVs instead to eliminate the clutter of excess code. For
      example, my tables used to look like this:

      <table>
      <tr>
      <td class="head2">First Row, First Column</td>
      <td class="head2">First Row, Second Column</td>
      </tr>
      <tr>
      <td class="head2">Second Row, First Column</td>
      <td class="head2">Second Row, Second Column</td>
      </tr>
      </table>

      With my stylesheet looking something like this:

      td.head2 {
      background: #d1d1ad;
      color: #000000;
      font-size: 12px
      }

      ********************************

      Now if I want all my information in the table to be formatted the
      same, I'll do this:

      <div class="head2">
      <table>
      <tr>
      <td>first row, first column</td>
      <td>first row, second column</td>
      </tr>
      <tr>
      <td>second row, first column</td>
      <td>second row, second column</td>
      </tr>
      </table>
      </div>
      With the stylesheet looking something like this:

      .head2 {
      background: #D1D1AD;
      color: #000000;
      font-size: 12px
      }


      Note that there are no carriage returns between the <TD> and </TD>
      tags, this eliminates the spaces you may be talking about..

      If my table has information in it that I want to format in different
      ways, and it usually does, I'll use contextual selectors in my
      stylesheet..

      Best Regards,

      John







      --- In ntb-html@y..., ARTIS <artis@a...> wrote:
      > Has anyone got some suggestions regarding the following style types
      for
      > CSS. They look just how I want them BUT, much of my work is within
      table
      > cells and if I use
      > "td class=head2" I have the space below that I haven't been able to
      > eliminate. If I use the body head (eg, body class="head2") with a
      > closing body tag within TD tags, it works fine, BUT html tidy wants
      to
      > eliminate it. Is there a problem with that?
      > -----------------------------
      > body {font-family: verdana, arial, san-serif; font-size: 75%;}
      > td {font-family: verdana, arial, san-serif; font-size: 75%;}
      >
      > body.head1 {font-family: arial, garamond, arial, san-serif;
      font-size:
      > 150%;}
      > body.head2 {font-family: garamond, arial, san-serif; font-size:
      100%;}
      > td.head1 { font-family: garamond, arial, san-serif; font-size:
      150%;}
      > td.head2 { font-family: garamond, arial, san-serif; font-size:
      100%;}
      > ---------------------------------
      > ...any suggestions greatfully received.
      > Niam
      >
      >
      >
      > [Non-text portions of this message have been removed]
    • Show all 5 messages in this topic