Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

171
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda