So I was trying to optimize my website for different ratios. However I can not position the image on the left side and the text on the right side on desktop.
This is my content [html] (text and image):
.wrapper{
width: 100%;
}
.wrapper img-info{
width: 100%;
}
.img-info h2{
width: 100%;
padding: 30px 30px 20px;
font-size: 50px;
color: #111;
line-height: 44px;
}
.img-info p{
padding: 0px 30px 20px;
font-size: 16px;
color: #111;
line-height: 24px;
}
.startseite-img{
width: 100%;
}
@media only screen and (min-width:768px){
.wrapper{
width: 600px;
margin: 0 auto;
}
.img-info h2{
width: 100%;
padding: 20px 0px 0px;
}
.img-info p{
padding: 20px 0px 0px;
}
.startseite-img{
padding-top: 30px;
}
}
@media only screen and (min-width:1000px){
.wrapper{
width: 1000px;
}
.wrapper img-info{
width: 50%;
float: right;
}
.img-info h2{
padding: 20px 0px 0px 30px;
}
.img-info p{
padding: 20px 0px 0px 30px;
}
.startseite-img{
padding-top: 0px;
width: 50%;
float: left;
}
}
<div class="wrapper">
<article class="img-info">
<h2>Hi!</h2>
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
<p> At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et
dolore magna aliquyam erat, sed diam voluptua.</p>
</article>
<img class="startseite-img" src="https://via.placeholder.com/150">
</div>
To give you an idea of my problem here's a screenshot: false positioning with the img When you still have any questions about my problem, you can visit the website kevnkkm.de to see the full html/css source code or just comment on this question!
Thanks in advance! (Also sorry for the facepalms I might have caused xd)