This is simple for you, but annoying as hell for me

Discussion in 'General Scripting Chat' started by kharm, May 14, 2010.

  1. kharm

    kharm Power Member

    Joined:
    Feb 9, 2009
    Messages:
    529
    Likes Received:
    99
    Occupation:
    Entrepreneurship
    So all I'm trying to do is this..

    I have a few <p id="whatever"> tags that I want to Autohide, so they just don't display at all when the page is loaded.

    Is there javascript or general CSS I can use to automatically do this. One thing to note is I can't enter 'display: none;' on each div post. any thoughts?
     
  2. voyevoda

    voyevoda Regular Member Premium Member

    Joined:
    Mar 21, 2010
    Messages:
    217
    Likes Received:
    97
    Location:
    Eastern Front
    You can hide stuff using CSS pretty easily.

    Code:
    p#whatever { display: none; }
    Note that valid HTML/XHTML does not allow IDs to be repeated! If you want to apply a particular set of CSS attributes to a bunch of elements, use a class name (e.g., <p class="hidden">) and use this instead.

    Code:
    .hidden { display: none; }
     
    • Thanks Thanks x 1
  3. kharm

    kharm Power Member

    Joined:
    Feb 9, 2009
    Messages:
    529
    Likes Received:
    99
    Occupation:
    Entrepreneurship
    √√perfect answer thanks!√√