Ich versuche, zwei divs mit einer Breite von jeweils 50% zu platzieren, aber irgendwie ist es nicht in der gleichen Zeile, aber wenn ich 49% tun stapelt es in der gleichen Zeile. Kann mir bitte jemand sagen, was ich falsch mache mit dem Code (mehr interessiert, die Ursache zu kennen als Lösung).Inline zwei divs nebeneinander - CSS
CSS -
* {
padding: 0;
margin: 0;
}
.wrapper {
width: 100%;
}
.left-c {
width: 50%;
background: #3EF00C;
display: inline-block;
}
.right-c {
width: 50%;
background: #2E4E6E;
display: inline-block;
}
HTML -
<div class="wrapper">
<div class="left-c">
<p>LEFT ----- This is going to be some random text placed in a a left container inside the wrapper. I hope this text will suffice the requirement.</p>
</div>
<div class="right-c">
<p>This is going to be some random text placed in a a right container inside the wrapper. I hope this text will suffice the requirement. ----- RIGHT</p>
</div>
</div>
JS Fiddle - https://jsfiddle.net/no0chhty/1/
https://jsfiddle.net/no0chhty/4/ – mika