skip to Main Content

I have a some picture with border add with photoshop but these border are dirty.
I would overwrite these border without doing it with photoshop again (Can not use a script because almost every picture are too specifics), because my client gave me about 15000 pictures with this error..

Then, I though about css border.
So, how can I make the border around the image to fill the inside of it ?

Is it possible ? Have you a better idea ?

EDIT

List of ideas which don’t work for my case:

  1. css attribute : border-style: inset (thank you anyway Abdul Basit)
  2. css attribute : clip

Thank you in advance.

2

Answers


  1. you can give inset border

       border-style: inset;
    

    can add a width that covers approx of all borders

        border-width: 5px;
    

    or you can use image as a border for all.

    Login or Signup to reply.
  2. You can use box-shadow with inset to simulate a border. However the box-shadow does not work directly on the image element, because it will render behind.
    You can solve this by making an .image-wrapper class with a box-shadow on.
    And to make this shadow render in front of your image you just need to set the z-index to -1.

    * { box-sizing: border-box; }
    
    .img-wrapper {
        box-shadow: inset 0 0 0 20px red; // Fake border on the inside
        display: block;
        margin: 50px auto;
        width: 90%;
    }
    
    .img-wrapper img {
        display: block;
        position: relative;
        width: 100%;
        z-index: -1; // Render the image behind the box-shadow
    }
    

    Demo

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search