Treehouse: Grow your CSS skills. Land your dream job.

Call name tag in CSS

  • # December 8, 2011 at 3:20 pm

    I am wondering if it is possible to do

    display: none;

    on the name HTML tag?

    And if so how? Google is not being helpful for once.

    # December 8, 2011 at 3:23 pm

    What? What name tag?

    # December 8, 2011 at 3:58 pm

    Ok so I have this in the page:


    Is there any way with CSS to hide the image, and only this one specific image. I can’t assign a custom class btw.

    # December 8, 2011 at 4:08 pm

    You could do this:

    img[src="images/nav_help.gif"] { display: none; }
    /* or */
    img[alt="help"] { display: none; }
    /* or */
    img[name="help"] { display: none; }

    Whichever you feel is best.

    # December 8, 2011 at 4:17 pm


    img[src="images/nav_help.gif"][alt="help"][name="help"] {display: none;}
    # December 8, 2011 at 4:23 pm

    Note: I’m not sure if IE8 will be able to handle @cnwtx ‘s example.

    # December 8, 2011 at 4:37 pm

    That worked thanks. Had no idea you could actually reference the HTML like that.

    # December 8, 2011 at 4:39 pm

    jamy_za, I just tested it works in IE7 and IE8.

    # December 8, 2011 at 6:20 pm

    That even works in IE7?


    # December 8, 2011 at 7:05 pm

    Sure does:

    # December 9, 2011 at 12:34 am

    Weird, I’m very sure I’ve had IE7 problems when using this input[type=”text”] – IE7 must have some kind of buggy implementation.

    @joshuanhibbert small note, but caniuse says:

    “Allows more accurate element selecting, using >, +, [attr], :first-child, etc.”

    and lists IE7 as supported, however IE7 has buggy :first-child support ( which I feel should be mentioned with a yellow block or something )

    Edit: I see there is a partially supported colour, but they don’t use that for IE7

    # December 9, 2011 at 12:54 am

    @jamy_za I wish they were more specific, I was only meaning to show the attribute selector. And there are newer attribute selectors that won’t work in IE7 too.

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.