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

239
Visualizações
Showing the cropped image over the original using css

the output that I want

the one that I have implemented so far

The grey colour background is the background colour of the lined div which is in absolute position to show the crop selection. I want the area inside the line without any colour so that part of the image would be visible and rest should be of grey background as it is.

.bounded-image {
width: fit-content;
position: relative;
}
img {
width: 292px;
}
.bordered-image {
    position: absolute;
    border: 1px dashed #5035e1;
    box-sizing: border-box;
    width: 140.816px;
    height: 260.12px;
    top: 71.2428px;
    left: 76.4561px;
    background: transparent;
}
.bg-image {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 4;
    background: black;
    opacity: 0.4
}
<div className="bounded-image">
  <img src="https://qoiowqcb.app.blr.streamoid.com/mls-data/streamoid_internal/images/76da8ac2445d14d23529390b63b19d4a"/>
   <div className="bg-image"></div>
   <div className="bordered-image" ></div>
 </div>
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I have prepared a possible solution to your problem. However, the question is whether the inner <div class="bordered-image"> is a fixed size? Because otherwise you need to adjust the value of the background-size: calc(170%); property.

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.bounded-image {
    width: fit-content;
    position: relative;
    width: 500px;
    height: 700px;
}
img {
    width: 100%;
}
.bordered-image {
    position: absolute;
    border: 1px dashed #5035e1;
    width: 300px;
    height: 450px;
    top: 130px;
    left: 100px;
    background: url(https://qoiowqcb.app.blr.streamoid.com/mls-data/streamoid_internal/images/76da8ac2445d14d23529390b63b19d4a);
    background-position: center;
    background-size: calc(170%);
    background-repeat: no-repeat;
    z-index: 5;
}

.bg-image {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: black;
    opacity: 0.4;
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="style.css">
    <title>Document</title>
</head>
<body>
    <div class="bounded-image">
        <img src="https://qoiowqcb.app.blr.streamoid.com/mls-data/streamoid_internal/images/76da8ac2445d14d23529390b63b19d4a"/>
        <div class="bordered-image"></div>
        <div class="bg-image"></div>
    </div>
    
</body>
</html>

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