Grow your CSS skills. Land your dream job.

How can I hide the default color af a display: block?

  • # July 18, 2009 at 3:01 pm

    Hi to all !!!

    I’ll paste here my code that I made for a btn… ( the page that I am checking is not on line yet ) but the problem is that the ‘div’ has borders colored in blue… don’t know why… I just would like to hide this borders.. I’ve tried with border-style: hidden and some more ways…

    Code:
    #btn{

    background-repeat: no-repeat;
    width:172;
    height:36;
    margin-left:33%;
    margin-top:-20%;
    display: block;

    }

    HTML code:

    Code:

    Thanks so much!! Mc.

    # July 18, 2009 at 3:49 pm

    It’s the image that has the border, not the div.

    Add:

    a img {
    border:none;
    }

    to your CSS.

    # July 18, 2009 at 4:00 pm

    Otherwise, the if you give the image an HTML attribute of border="0" it will also remove the border.

    By default, images that are hyperlinked automatically get the blue border (like the blue and underline for hyperlinked text.

    # July 18, 2009 at 4:03 pm

    Fantastic tip!!!

    And the right way is:

    Code:
    a img {
    border:none;
    }

    Thanks so much !!!

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

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".