Justify-content not working


Joined
Mar 7, 2021
Messages
10
Reaction score
0
Hey guys,
My justify content doesn't work...

HTML:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Enigma Room - Tarifs</title>
    <link rel="stylesheet" href="./styletarifs.css">
</head>
<body>
    <header id="main-header">
        <div class="container">
            <h1><a href="Index.html">EIB Escape</a></h1>
        </div>
    </header>
    <nav id="navbar">
        <div class="container">
            <ul>
                <li><a class="button" href="../home/index.html">Accueil</a></li>
                <li><a class="button" href="tarifs.html">Tarifs</a></li>
                <li><a class="button" href="#">La Room</a></li>
                <li><a class="button" href="#">Nous Contacter</a></li>
            </ul>
        </div>
    </nav>
    <main id="main">
        <div class="main">
            <h1>Enigma</h1>
        </div>
    <div class="container-1">
        <div id="box-1">
            <h1>Box-1</h1>
            <p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quod, quibusdam mollitia expedita dignissimos blanditiis ullam obcaecati illum illo laudantium accusantium!</p>
        </div>
        <div id="box-2">
            <h1>Box-2</h1>
            <p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quod, quibusdam mollitia expedita dignissimos blanditiis ullam obcaecati illum illo laudantium accusantium!</p>
        </div>
        <div id="box-3">
            <h1>Box-3</h1>
            <p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quod, quibusdam mollitia expedita dignissimos blanditiis ullam obcaecati illum illo laudantium accusantium!</p>
        </div>
    </div>
    </main>
    <footer id="main-footer">
        <p> No Copyright &copy; Eib Escape</p>
    </footer>
</body>
</html>

CSS:
body{
    background-color: #f4f4f4;
    color: #555;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.6em;
    margin: 0;
}

.container-1{
    display: flex;
    flex-direction: row;
    justify-content: space-between;

}

.container-1 div{
    border: 1px #ccc solid;
    padding: 20px;
}

.container{
    width: 80%;
    margin: auto;
    overflow: hidden;
}

#main-header{
    background-color: rgb(40, 40, 40);
    color: #fff;
    text-transform: uppercase;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 1em;
}

#main-header h1{
    padding-left: 20px;
    padding-right: 20px;
}

#main-header a{
    text-decoration: none;
    color: #fff;
}

#navbar{
    background-color: #333;
    color: #fff;
}

#navbar ul{
    list-style: none;
    padding: 0;
}

#navbar li{
    display: inline;
}

#navbar a{
    color:#fff;
    text-decoration: none;
    font-size:18px;
    padding-right:15px;
}

#main-footer{
    text-align: center;
    background:rgb(170, 170, 170);
    position:absolute;
    bottom:0;
    width: 100%;
    padding-top:0px;
    height: 50px;
}

.button{
    background-color:#333;   
    color:#fff;
    padding:20px 20px;
    border:none;
    text-decoration: none;
}

.button:hover{
    background:rgb(100, 100, 100);
    color:#fff;
}

.main h1{
    text-align: center;
    margin-bottom: 50px;
    margin-top: 50px;
    padding: 20px;
    overflow: hidden;
    width: 80%;
}

Thanks if you help me !
 
Ad

Advertisements

Joined
Nov 27, 2019
Messages
163
Reaction score
24
Give your DIVs a width, else they will take up all the room there is and you don't have room left for a margin between them.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top