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 4 of 4
  1. #1
    Regular Coder
    Join Date
    Sep 2011
    Posts
    265
    Thanks
    49
    Thanked 1 Time in 1 Post

    display:none; not working

    On this website, the page links to /hidden.css, which contains:

    ul#ASP-NET-frameworks, ul#C-frameworks, ul#C++frameworks, ul#CFML-frameworks, ul#js-dom, ul#gui-related, ul#js-visualisation, ul#js-web-application, ul#pure-javascript, ul#js-template-systems, ul#js-unit-testing, ul#js-other, ul#js-see-also, ul#js-libraries, ul#php-frameworks {
    display: none;
    }

    Essentially, this stylesheet is there to collapse some of the UL elements in the table of contents. There is a jQuery script to toggle() the UL's display on click.

    However, my Chrome code inspector is not detecting this style as being computed. Why is this?
    Last edited by SRD75; 03-12-2014 at 04:15 AM.

  • #2
    New Coder
    Join Date
    Sep 2012
    Location
    Murcia, Spain
    Posts
    21
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Have you tried "display:none!important;"

    The "!important" string makes it overwrite any styles that do NOT contain "!important"

    For example:
    div.tohide { (Even though this line is above the style that tells it to show, the div.tohide will remain hidden due to the "!important" being set to hide)
    display: none!important;
    }
    div.tohide { (Removing the "!important" will make this style active again)
    display: block;
    }

    Hope this helps!

    Kind regards, Ben
    Freelance and available every day! Check out my portfolio at vnbenny.com

  • #3
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,956
    Thanks
    9
    Thanked 727 Times in 721 Posts
    Your code without the !important works fine in Chrome for me.
    Use the W3C HTML Validator and CSS Validator to check your code and Firebug to see what css is applied to an element
    Read Steve Krug's book Don't Make Me Think - essential reading on web usability
    I don't recommend much, but I do recommend Clook for UK web hosting

  • #4
    Regular Coder
    Join Date
    Sep 2011
    Posts
    265
    Thanks
    49
    Thanked 1 Time in 1 Post
    Yeah, it works for me in Chrome on another computer. Perhaps my Chrome on my first computer remembered my actions. On my first computer, I was viewing local files too, not remote files.

    Thanks to both of you.


  •  

    Tags for this Thread

    Posting Permissions

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