In each div#tickets I have an image and some text.
My expected result: In bigger screen inside #tickets the text will be beside the image and in smaller screen the text will be down the image. The parent div (#tickets) of the image and text has a white background and black text.
But height, weight, background color, parent divs nothing is working out. The result is being absolute mess. Can anyone help?
I tried using box-sizing:border-box also, but result is same.
*{
background-color:black;
}
fieldset{
max-width:960px;
margin:0 auto;
border-color: transparent;
position: relative;
}
#tickets{
max-width:100%;
background-color:white ;
border-radius:25px;
color:black;
margin:25px;
font-size:70px;
}
@media screen and (max-width: 600px) {
#tickets{
margin:25px 10px;
font-size:70px;
}
}
#tickets img{
width:40%;
float:left;
margin-right:30px;
}
@media screen and (max-width: 600px) {
#tickets img{
width:100%;
margin-right:0 auto;
}
}
<fieldset>
<div id="tickets">
<img src="https://st.depositphotos.com/1428083/2946/i/950/depositphotos_29460297-stock-photo-bird-cage.jpg">
<div class="text">
Hello
</div>
</div>
<div id="tickets">
<img src="https://st.depositphotos.com/1428083/2946/i/950/depositphotos_29460297-stock-photo-bird-cage.jpg">
<div class="text">
Hello
</div>
</div>
</fieldset>