Support » Themes and Templates » Change default image border colour

  • Hi

    I want to change the colour of the image border so that when I put a border around an image it is grey instead of black as default.

    Is there a way to do this without doing it manually every time?


Viewing 8 replies - 1 through 8 (of 8 total)
  • probably by changing/adding some styles in style.css of your theme;

    what theme are you using?

    link to your site?

    Sure… you need to modify the default border color in the css of the theme you are using… Some theme might have an interface to modify them, else, go editing the css directly is the solution…

    I’m not sure where to change the code.

    My site is here:

    Sorry I should have linked it first.

    I’m using an Elegant Themes theme.

    i can’t find any instances of images with black frames – the stylesheets don’t have img styles with borders;

    can you post a direct link to a post/page where the ‘default’ black border shows, and where you have edited that to grey?


    I have manually changed them to grey. Maybe I should explain more clearly.

    When I add a border to an image via the Add Image button it adds a black-coloured border as default which I then have to manually change to grey. I want to set the style sheet or add a grey-coloured border by default instead of black. Is there any way to do this?


    I understand I have to edit the CSS but am not sure which bit to edit.

    I had the same problem. Found the solution with jQuery. This might work for you too

    $('.entry-content img').each(function() {
    		  var brdrColor = $(this).css("border-left-color");  
    		if ( brdrColor == 'rgb(0, 0, 0)' || brdrColor == '#000000' ){

    in my case .entry-content is container for wp_content(), so the script checks if there is an image inside the content with default (black) border and replaces the color with new one

    Thanks! Looks useful but I can’t find where that code might be. Any ideas?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Change default image border colour’ is closed to new replies.