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 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Nov 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How do i stop a table cell inheriting the css body attributes

    I have designed a website in drupal and for the most part it has gone well. I have been asked to make the font on every page aside from the front bigger now however. On the front I have a separate css rule:

    Code:
    .fronttable {
      border:0px;
      font-family: verdana, Helvetica, sans-serif; 
      font-size: 1.0em;
      text-align: left;
      color: #133c63;
      line-height:normal;
      font-weight:normal;
      margin-bottom:10px;
      padding-bottom:9px;
      }
    that is referenced by

    Code:
     class="fronttable"
    in the table cell (i do not want it affecting every cell)

    However, when i then change the body size the table cell also changes. According to firebug it is picking up some of my table style, but inheriting other parts, namely size, from the body class. Does anybody know how to stop this from happening? the site is at www.fidelitypayment.com

    Thanks so much!

  • #2
    Regular Coder seco's Avatar
    Join Date
    Nov 2008
    Location
    Oregon
    Posts
    687
    Thanks
    6
    Thanked 79 Times in 77 Posts
    yes, use div's. tables are definant.

  • #3
    New to the CF scene
    Join Date
    Nov 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    that worked a charm, thanks so much!!

  • #4
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,296
    Thanks
    10
    Thanked 583 Times in 564 Posts
    reset your cells:
    Code:
    .fronttable td {font-size: 14pt; color:black;}
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/5/28) IE7:0.1, IE8:5.3, IE11:8.4, IE9:3.2, IE10:3.2, FF:18.2, CH:46, SF:7.9, NON-MOUSE:32%

  • #5
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,300
    Thanks
    28
    Thanked 275 Times in 269 Posts
    Quote Originally Posted by jamesgrayking View Post
    However, when i then change the body size the table cell also changes. According to firebug it is picking up some of my table style, but inheriting other parts, namely size, from the body class. Does anybody know how to stop this from happening?
    em is a relative unit based on the font size of the parent element. Unless you had a static font size declared on an element between the body and td elements, naturally, any change in size on the body element would cause a proportional change in size of the td element.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #6
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,296
    Thanks
    10
    Thanked 583 Times in 564 Posts
    the cascading is less understood than the styling...
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/5/28) IE7:0.1, IE8:5.3, IE11:8.4, IE9:3.2, IE10:3.2, FF:18.2, CH:46, SF:7.9, NON-MOUSE:32%


  •  

    Posting Permissions

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