WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] borders parsed (10 posts)

  1. Dot
    Member
    Posted 1 year ago #

    Hello,
    the borders around my images have parsed, but now the code to prevent a border around my header (/branding) image isn't working? http://deardot.com/

  2. Andrew
    Forum Moderator
    Posted 1 year ago #

    Your branding has a border applied specifically to it, disregarding any image borders you may have added.

  3. Dot
    Member
    Posted 1 year ago #

    And yet when I manipulate the borders to the other images, that around the branding image changes?

  4. Andrew
    Forum Moderator
    Posted 1 year ago #

    Which CSS are you using for this?
    Which browser & browser version are you using?

  5. Dot
    Member
    Posted 1 year ago #

    Hello

    What I would like is to code to ensure a grey border, with a black outline, around all but my header image!
    I'm using the following code:

    img {
    padding:1px
    border:1px solid #021a40;
    background-color:#ff0;
    }

    #branding img {
    padding: 0;
    border: none;
    }

    img{
    border:1px solid #000000!important;
    }

    At the moment I'm just getting a black outline, which includes my header image!

  6. Andrew
    Forum Moderator
    Posted 1 year ago #

    You're overriding the #branding img style with the preceding img style.

    Generally the lower down the style in the CSS file, the higher precedence that style has.

  7. Dot
    Member
    Posted 1 year ago #

    It doesn't make any difference; I changed it around:

    img {
    border: 1px solid #000000 ! important;
    }

    #branding img {
    border: 0px
    padding: 0px ! important;
    }

    :/

  8. Andrew
    Forum Moderator
    Posted 1 year ago #

    There's a style on line 39

    img{
     border:1px solid #000000!important;
    }

    Get rid of !important.

  9. Dot
    Member
    Posted 1 year ago #

    When I take out the !important, the border of all of the images disappears!

  10. Andrew
    Forum Moderator
    Posted 1 year ago #

    You'll need to use more range of CSS selectors and avoid using !important until absolutely necessary, otherwise you'll run into overriding styles not meant to be overridden (as you've just experienced).

    Here's an article of CSS specificity.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.