* { margin: 0; padding: 0; transition: .3s; background: url('img/crossword.png'); } .header { margin: 10px auto; width: 960px; height: 400px; border-radius: 5px; background: rgba(0, 0, 0, .8); box-shadow: 0px 2px 3px rgba(0,0,0,.4); } @media only screen and (max-width: 950px){ .header { width: 600px; background: #000; } } @media only screen and (max-width: 610px){ .header { width: 200px; background: #000; } } .container { display: inline; } .first { margin: 10px auto; width: 300px; height: 200px; border-radius: 5px; background: rgba(0, 0, 0, .8); box-shadow: 0px 2px 3px rgba(0,0,0,.4); } .second { margin: 10px auto; width: 300px; height: 200px; border-radius: 5px; background: rgba(0, 0, 0, .8); box-shadow: 0px 2px 3px rgba(0,0,0,.4); } <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <link rel="stylesheet" href="style.css"> </head> <body> <div class="header"></div> <div class="container"> <div class="first"></div> <div class="second"></div> </div> </body> </html> How to put a container inline