Support » Themes and Templates » Remove grey line/border around images on twenty eleven

Viewing 9 replies - 1 through 9 (of 9 total)
  • Moderator Andrew Nevins


    General CSS queries can be asked in general CSS forums such as;

    Or you could try using a browser developer tool for this kind of exploratory CSS work.
    I used Google Chrome’s built-in Developer Tool just because I find it particularly easy to expose underlying HTML and CSS as compared to Firebug.

    Now that you know the style, from being exposed/added by the Developer Tool, you can add a new style to override it.

    You ought to add new styles externally, not within the theme’s files. Changes to the theme’s files will compromise the theme and be compromised when the theme updates.

    External changes can be made using a Child Theme or through a plugin that provides Custom CSS functionality.

    I recommend using the Jetpack plugin and its Custom CSS functionality to hold your CSS modifications.

    I have jetpack I just wanted to know if I could remove the grey line around my images – not generally a CSS matter but just needed help with it!

    Yes, that’s entirely CSS – the border is set here:

    img[class*="align"], img[class*="wp-image-"], #content .gallery .gallery-icon img {
        border: 1px solid #DDDDDD;
        padding: 6px;

    Copy that to your child or custom CSS and set the border to zero.

    Tried that and other things. No matter what I do, I still get the grey lines around images, even when I edit the settings in the original style.css file (not the child). Could it have something to do with the entries being imported from Blogger?


    Moderator Andrew Nevins


    @navigill, in which page are the grey lines?

    Hi Andrew,
    They’re on the main page I get when I click the link in my above post, on every image, even on the pages I get when I click the post titles.

    I was able to change the lines below posts, but want to completely remove them near the images.

    Also, When I use:

    img[class*=”align”], img[class*=”wp-image-“], #content .gallery .gallery-icon img {
    border: none;
    padding: 0px;

    The borders go away in safari, but still appear in Firefox.

    They appear in Firefox, only when I hover over the image.

    Moderator Andrew Nevins


    For some reason your image on that page is in a table.
    Have you therefore tried adding CSS border: none; to the <table> and <td>?

    I see what you’re saying. When I made the entries in Blogger, the images were automatically put into tables by Google’s system.

    I went into the, “Relax Like Simple” entry and removed the table code. Problem solved. That’s what I’ll do from now on.

    Thank you! I would not have caught that.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Remove grey line/border around images on twenty eleven’ is closed to new replies.