Results 1 to 5 of 5
  1. #1
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CSS question class within div

    Hi,

    In CSS, how do I refer to a class within a div?

    I have the following xhtml code:

    <div id="vertmenu">
    <ul>[*]<a class="b" href="http://www.jkp-ads.com/indexEN.htm">English
    site</a>[*]
    News[*]
    Headlines[*]
    Products[/list]</div>

    Suppose I want to show the class "a" links in black text and the class "b" in
    red, how do I refer to those classes within the div "vertmenu"?
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  2. #2
    5 Star Lounger
    Join Date
    Apr 2003
    Location
    Hampshire, United Kingdom
    Posts
    602
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CSS question class within div

    #vertmenu a.a {
    color: #000000;
    }

    #vertmenu a.b {
    color: #ff0000;
    }

    should work.
    Waggers
    If at first you do succeed, you&#39;ve probably missed something.

  3. #3
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CSS question class within div

    Thanks!

    Would you know any good resources on how this css referencing stuff works?
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  4. #4
    5 Star Lounger
    Join Date
    Apr 2003
    Location
    Hampshire, United Kingdom
    Posts
    602
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CSS question class within div

    The best reference by far for all things CSS is http://www.w3schools.com/css/.
    Waggers
    If at first you do succeed, you&#39;ve probably missed something.

  5. #5
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CSS question class within div

    That figures!
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

Posting Permissions

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