0
I am a laywoman in flexbox, and I have difficulty in aligning the items inside the flex, I determined size for them, but when it comes to positioning, they don’t look the same, they always look different and I want a pattern for everyone. If anyone can see in my code where I’m missing, I’d appreciate it.
This is the layout It needs to look like this
My code below
<div class="container">
<!-- Linha 1: flex-direction: row -->
<div class="flex1">
<div class="dltop"> <!-- flex: 0.75, flex-direction: row -->
<div>
<!-- col 1: IMAGEM ICON aqui -->
</div>
<div>
<div id="overflow_ellipsis">Objetivo: <?=$linha['objetivo'];?></div>
</div>
</div>
<div class="dlbottom">
<div class="gat"><strong>Gatilho/Situação:</strong> <?=$linha['situacao_gatilho'];?></div>
</div>
<div class="dcbottom">
<div class="canalproposto">Canais: <?=$linha['canal_proposto'];?></div>
<div class="fase">Fase: <?=$linha['fase'];?></div>
<div class="cod">Código: <?=$linha['codigo'];?></div>
</div>
</div>
<!-- Linha 2: flex-direction: row -->
<div class="flex2">
<div class="drtop">
<!-- flex: 0.25 -->
<div class="sit">Situação: <?=$linha['data'];?></div>
<button class="but"> Detalhes </button>
</div>
</div>
</div>
css
* {
margin: 0;
padding: 0;
}
header h2 {
text-align: center;
margin-top: 10px;
font-family: 'Times New Roman', Times, serif;
font-size: 25px;
}
.container{
flex-wrap: wrap;
border: 1px solid black;
}
#overflow_ellipsis{
width:70%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.dltop{
width:80%;
font-size: 15px;
font-weight: bold;
background-color: orange;
}
.dlbottom{
width:30%;
}
.dcbottom{
justify-content: center;
width: 60%;
}
.flex1{
flex-direction: row;
}
.gat{
font-size: 14px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.but{
font-size: 14px;
float: right;
margin-bottom: 30px;
}
.sit{
font-size: 14px;
float: right;
background-color: tomato;
width: 20%;
}
.gat{
font-size: 14px;
background-color: #34ce57;
}
.fase{
background-color: #f1b0b7;
}
.canalproposto{
background-color: chartreuse;
}
.cod{
background-color: lightcoral;
}
It needs to be css and html in this structure ?
– Pedro Henrique