Results 1 to 5 of 5

Thread: addressing sub elements in css

  1. #1
    Join Date
    Jan 2007
    Posts
    51
    Thanks
    2
    Thanked 3 Times in 3 Posts

    Default addressing sub elements in css

    Howdy all -

    So I'm a little unsure about how you address(style) sub elements via css. This area always confuses me...

    I have the following spans:

    <span class="tabsOCBox">Stations List: <span id="stationListOpen">Open</span><span id="stationListClose">Close</span></span>

    <span class="tabsOCBox">Station Details: <span id="stationDetailsOpen">Open</span><span id="stationDetailsClose">Close</span></span>

    And the following styles:

    // works great and sytles both 'tabsOCBox'
    .tabsOCBox{
    background-color: #ffffff;
    border: 1px solid #000000;
    width:100%;
    }

    // I'd like to style the inner spans as such, but I don't think I'm addressing it right
    .tabOCBox span{
    border-top:2px solid #c0c0c0;
    border-left:2px solid #c0c0c0;
    }


    Thoughts?

    Thanks for you time!
    BN

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    No, that's quite right.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Jan 2007
    Posts
    51
    Thanks
    2
    Thanked 3 Times in 3 Posts

    Default

    hmmm... that's odd. It doesn't work

    I broke it out into seperate selectors for each inner span, that worked.. but isn't ideal.

    I'll monkey with it a bit...

    BN

  4. #4
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default

    depending on what the rest of your css looks like, there maybe something declared later in the css which is overriding the styles you are trying to apply. Look for other rules which have the same class or id in your css... If there are any, they may be preventing you from styling it the way you want.
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

  5. #5
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    No, I don't think it will work. The declaration does'nt address to any element that you are showing unto us.

    There is no element whose class name is tabOCBox.

    Maybe you mean tabsOCBox:
    Code:
    .tabsOCBox span{
    border-top:2px solid #c0c0c0;
    border-left:2px solid #c0c0c0;
    }
    Hope it helps.
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

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
  •