Results 1 to 2 of 2

Thread: Applying properties to multiple styles.

  1. #1
    Join Date
    Aug 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Applying properties to multiple styles.

    Hi there.

    Im still new to all this CSS stuff, but there's something that I can do with IE that I can't do in Netscape and I was wondering if its just a bug that works with IE and is is possible to do in netscape.

    Here is an example of how the styles used;

    .maintext
    {font-size:12px;color:#333333;}
    .smalltext
    {font-size:11px;color:#333333;}
    .headertext
    {font-size:12px;color:#FFFFFF;font-weight:bold;}
    #test
    {}
    #test .maintext
    {color:#FFFFFF;}
    #test .smalltext
    {color:#FFFFFF;}
    #test .headertext
    {color:#FFFFFF;}

    An an example of a table structure to apply it to;

    <table>

    <tr>
    <td>
    <span class="headertext">a header</span>
    <span class="maintext">text here</span>
    <span class="smalltext">small text here</span>
    </td>
    </tr>

    <tr>
    <td>
    <div id="test">
    <span class="headertext">a header</span>
    <span class="maintext">text here</span>
    <span class="smalltext">small text here</span>
    </div>
    </td>
    </tr>

    </table>

    This would then change the color of the second row of text to white.
    In Internet explorer I was able to add;

    #test .maintext, #test .headertext, #test .smalltext {color:#FFFFFF}

    instead of the 4 lines used above and I would achieve the same results, however this doesnt work in other browsers. Is there a way to get this to work?

    Cheers.

    Andy

  2. #2
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    that is the proper syntax so I am guessing that you it is something that you are not doing that is causing the standardized browsers to display accordingly. if you could create the page and give us a link we would better be able to help you with exactly where the error occurs

Bookmarks

Posting Permissions

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