Ich möchte einen Container erstellen, der zwei Elemente mit den im Bild angegebenen Farben enthält. Die beiden sind verschiedene Divs und müssen nebeneinander bleiben. Wie mache ich es?Wie behalte ich die divs nebeneinander im Container?
Hier ist mein Code:
<html>
\t <head>
\t \t <title>Testing</title>
\t \t <style>
\t \t .container{
\t \t \t width: 50%;
\t \t \t height: 50%;
\t \t }
\t \t .sidenav{
\t \t \t width: 25%;
\t \t \t height: 100%;
\t \t \t background-color: black;
\t \t }
\t \t .bgrnd{
\t \t \t width: 75%;
\t \t \t height: 100%;
\t \t \t background-color: blue;
\t \t \t float: left;
\t \t }
\t \t </style>
\t </head>
\t <body>
\t \t <div class="container">
\t \t \t <div class="sidenav">
\t \t \t </div>
\t \t \t <div class="bgrnd">
\t \t \t </div>
\t \t </div>
\t </body>
</html>
Dank! : D @ j08691 –