0
I’m having difficulty creating a div in which the width is 580px with the 767px media query, when I decrease the screen the div remains fixed at the same height value. How do I get gif to follow along when redirecting the screen. I made an example gif using the site vice.com/pt_br
https://giphy.com/gifs/JT2H2houQNkjNOOWw6/html5[![
*{
margin:0;
padding:0;
}
body{
background:#f2f0d5;
}
/*----- Div Mobile -----*/
@media (min-width:768px){
.container{
display:none;
}
}
@media (max-width:767px){
.container{
display:flex;
flex-wrap:wrap;
}
.col-box-1{
background:tomato;
border-bottom:3px solid black;
width:100%;
height:590px;
}
.col-box-1 img{
width:100%;
}
/*Podem ignorar essa parte*/
.col-box-1 h3{
font-family:arial;
font-weight:bolder;
text-transform:uppercase;
color:#f2f0d5;
font-size:2em;
text-align:center;
}
/*Podem ignorar essa parte*/
.col-box-2{
border-bottom:3px solid black;
padding:0 1em;
font-family:arial;
}
.col-box-2 h1{
padding-top:0.5em;
font-size:1.6em;
}
.col-box-2 a{
text-decoration:none;
color:inherit;
cursor:pointer;
}
.col-box-2 p{
padding-top:0.8em;
padding-bottom:1em;
font-size:0.8em;
}
}
/*----- Div Mobile -----*/
<!------ Div ------>
<section class="container">
<article class="col-box-1">
<img src="">
<h3>img</h3> <!--Podem ignorar essa parte-->
</article>
<article class="col-box-2">
<h1><a href="#">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod</a></h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in.</p>
</article>
</section>
<!------ Div ------>
You’re gonna use an image inside the div, right? put width:100px and height:768px in div, and in img put width:100% height:100%; Another alternative is to put the image as the background of the div and assign background-size:cover;
– Neo