Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

170
Views
to put border-pixel and border-radius around images

I try to create a container which hold a div with image but around image I should to create another element border: 1px solid #C7B273; in four party:

top, bottom, left, right and give another property necessary for border px around image.

Image has border-radius:0; By the UI/UX I understand that border: 1px solid #C7B273; should to stay margin-bottom after picture.

I try to do this:

img {
    border: 1px solid #999;
    border-radius: 10px;
    padding: 15px;
    position: absolute;
    margin-left: auto;
    margin-right: auto;
    display: block;
    z-index: 10;
}
<div class="border">
    <img src="./images/about.jpg" width="200px" height="256px" alt="Nature">
</div>

And get this results:

enter image description here

But result final should be like image:

enter image description here

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Something like that?

.w {
  height: 256px;
  width: 200px;
  position: absolute;
  border: 1px solid #999;
  border-radius: 10px;
}     
img {
  padding: 15px;
  position: absolute;
  margin-left: auto;
  margin-right: auto;
  display: block;
  z-index: 10;
}
    <div class="border">
      <div class="w"></div>
        <img src="https://via.placeholder.com/900/gray" width="200px" height="256px" alt="Nature">
    </div>

about 4 years ago · Juan Pablo Isaza Report

0

     
.border {
  height: 256px;
  width: 200px;
  position: relative;
} 
.image {
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
}

.div {
  content: "";
  border: 1px solid #C7B273;
  border-radius: 10px;
  position: absolute;
  width: 95%;
  height: 95%;
  bottom: -10px;
  left: -10px;
z-index: -1
}
  <div class="border">
  <img
  class="image"
  src="https://placeimg.com/200/256/nature"
  width="200px"
  height="256px"
  alt="Nature"
  />
  <div class="div"></div>
  </div>

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!