-2
I’m building a project and I had to use css, which by the way is not my strong suit, and I came across the following situation, the site needs to be responsive, but when I went to put elements inside a div in which the image not only needs to adapt its positioning but the size, the following situation happened:
Above, the elements should connect because this brown part symbolizes a pipe and is connected regardless of the size of the device, and burst the div as you can see, what will be happening?
Note: the elements are images divided in parts because I will work with the DOM.
Follow the html code of the page:
<div class="container">
<div id="bloco1" class="container">
<h4 class="text-center" id="blc1">Bloco 1</h4>
<img src="/img/caixa_vazio.png" alt="cisterna vazia" class="caixa">
<img src="/img/bombas_off.png" alt="bombas off" class="bombas">
<img src="/img/cisterna_vazio.png" alt="cisterna vazio" class="cisterna">
</div>
<div id="bloco2">
<h4 class="text-center" id="blc2">Bloco 2</h4>
</div>
</div>
css code applied:
#bloco1{
width: 410px;
height: 400px;
border: solid 5px rgb(64, 206, 250);
margin-top: 20px;
display: inline-block;
background: no-repeat url(/img/imagem_fundo.png);
background-size: cover;
}
h4#blc1{
margin-top: 10px;
border: 1px black;
background-color: rgb(64, 206, 250);
color: white;
border-radius: 20px;
}
#bloco2{
position: relative;
width: 410px;
height: 400px;
border: solid 5px rgb(64, 206, 250);
margin: 20px 0px 10px 10px;
display: inline-block;}
h4#blc2{
margin-top: 10px;
}
.caixa{
position: absolute;
width: 200px;
height: auto;
left: 322px;
margin-top: 2px;
}
.bombas{
position:absolute;
width: 200px;
height: auto;
left: 169.7px;
top: 150px;
}
.cisterna{
position:absolute;
width: 200px;
height: auto;
left: 359px;
top: 300px;
}
body{
margin-bottom: 10px;
}
Send the images so you can test the alignment on different devices. Use https://imgur.com/ links or other sharing device of your choice.
– Augusto Vasques
download from my drive: https://drive.google.com/file/d/1WAuWv7bhb6G9jB0-JwG8QYa_4MQACCJ7/view?usp=sharing
– Teuuz1994