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

    referencing DD element in CSS

    Hello and thank you for any attention to my question. I'm working with an html document that has a datalist set that I want to be able to hide and unhide the <DD> elements as I click the <DT> element ("Blah"). I believe my problem is that I'm not referencing the <DD> element properly in my CSS. Below is what I have...ideas?


    Code:
    <STYLE>
    BODY                 { font-size:95%; font-family:arial; }
    DL                     { cursor: hand; }
    DD                     { display: none;font: 90%;list-style: square; }
    .showList DD         { display: block; }
    .defaultStyles DD 	{ display: none; }
    </STYLE>
    Code:
    <DL>
    <DT onclick="this.className='showlist';" ondblclick="this.className='defaultStyles';">BlahBlah
    <DD>Blah 1
    <DD>Blah 2
    <DD>Blah 3
    </DL>

  • #2
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    dd is not a child of dt, yet that's how you've referenced it.
    Maybe try moving the onclick to the dl?

  • #3
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That was it. Thanks!


  •  

    Posting Permissions

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