This is the HTML I have:
<div class="data">
<div class="dataispod">
<div class = "detaljilevo">
<div class="detaljilevosub">
<h1 class="naslovdetalji"><?=$podaci->naziv?></h1>
<h4 class="kategorijadetalji"><span><?=$podaci->nazivKategorije?> zadatak • Neizvršen</span></h4>
<h4 class="opisdetalji"><?=$podaci->opis?></h4>
<h5 class="datum">Datum kreiranja: <?=$noviDatumKreiranja?></h5>
</div>
<div id="buttonwrapperdetalji">
<button type="submit" class="dugmedetalji" name="button" onclick="izvrsiZadatak();"><span class="puntekst">Izvrši zadatak</span><span class="krataktekst">Izvrši</span></button>
<form action="izmeni.php">
<button type="submit" class="dugmedetalji" name="button2" onclick="izmeni();"><span class="puntekst">Izmeni zadatak</span><span class="krataktekst">Izmeni</span></button>
</form>
</div>
</div>
<div class="slikacontainer">
<div class="slikawrap">
<img src="../slike/<?=$podaci->slika?>"/>
</div>
</div>
</div>
</div>
This is the CSS I have:
.data {
margin: 80px 60px 0px 80px;
position: relative;
background-color: #BEBDC3;
border-radius: 5px;
display: flex;
flex-direction: row;
justify-content: space-between;
height: 400px;
width: 70%;
}
.dataispod {
background-color: #ffffff;
border-radius: 5px;
display: flex;
justify-content: center;
align-items: center;
height: 400px;
width: 100%;
}
.detaljilevo {
display: flex;
flex-direction: column;
justify-content: space-between;
background-color: green;
height: 400px;
width: 50%;
}
.detaljilevosub {
display: flex;
width: 100%;
flex-direction: column;
}
.slikacontainer {
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
width: 50%;
background-color: rebeccapurple;
}
.slikawrap {
height: 60%;
width: 60%;
display: flex;
justify-content:center;
align-items:center;
overflow: hidden;
border-radius: 5px;
box-shadow: 5px 5px 20px #555555;
}
.slikawrap img {
border-radius: 5px;
overflow:hidden;
}
The user is supposed to upload the picture and I'm supposed to display it in the element. The user is allowed to upload pictures of any dimensions, so I'm trying to figure out a way to display them.
I've been trying to figure this out for hours but nothing seems to be working. I put the width as percentage on the slikawrap
class so it would be responsive, but that causes the parent div data
and dataispod
to resize when I want it to stay the same.