• Leah

    (@leahmarie)


    Please help!
    I have my own theme and want a default white border to be added for all my posted images. I don’t know code or where to place it. I have been searching online trying to find an answer.

    Thanks!

Viewing 10 replies - 1 through 10 (of 10 total)
  • marcelvanderhoek

    (@marcelvanderhoek)

    A line of CSS will do the trick:

    img{
    border: 2px solid white;
    }
    Thread Starter Leah

    (@leahmarie)

    Thank You Marcel but I don’t want a border on all my elements only the photos I post. What should I do?

    You must select the tag that hold the posts. Check it with your browser debugger and write it. Could be something like that:

    .entry img {
      /* your code */
    }

    Remember, don’t copy-paste it, check what is your entry tag!

    Thread Starter Leah

    (@leahmarie)

    I’m not exactly sure what you mean. I know very little coding. Can yo give me step by step instructions. Thanks

    I can not tell you what is your theme’s post wrapper CSS class to give you exact tip. Can you link me your site, this will greatly help. (and please, next time you have such questions link the site if its hosted somewhere)

    Thread Starter Leah

    (@leahmarie)

    My site is leahmarieblog.com, under Galleries tab is the example of a photo posted that needs a border.

    Thanks

    It can be styled like that:

    Select all images that are not floated to left or right, but you could just add the stylings for this with theWordPress CSS classes

    img.alignnone {
      /* your code */
    }

    or

    reach it by the way the theme is structored:

    #container #left img {
      /* your code */
    }

    The first one will select all images from all posts and apply styles to them and the secound will select all images from the div#container #left and apply styles to them.

    This is all you can do with the current theme structure. If you have more questions, ask ??

    Thread Starter Leah

    (@leahmarie)

    Thanks Xavortm! That worked, but now I realize that my white border does not show up on my white background. How do I change the color to an off white?

    Thread Starter Leah

    (@leahmarie)

    I just found a plug in WP Image Borders..I’m going to try that to get the look I’m going for.

    Thanks

    Instead of border: 2px solid white; You can write the color you need at the place of “white”. You can write HEX colors like #ddd, #ccc and such. Made your own here : https://www.colorpicker.com/. (you need to copy the letters above the picker and always have “#” before them)

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