Justify-Content tutorial in Flexbox CSS

 <!DOCTYPE html>

<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Justify Content Flexbox CSS</title>
    <link rel="stylesheet" href="css/Justify_Content_Flexbox_CSS.css">
</head>

<body>
    <h1>Hello World : CSS Justify-Content</h1>
    <div class="container">
        <div class="items item1">One</div>
        <div class="items item2">Two</div>
        <div class="items item3">Three</div>
        <div class="items item4">Four</div>
    </div>
</body>

</html>



Below File is css/Justify_Content_Flexbox_CSS.css File
body {
    font-family: arial, helvetica;
}

h1 {
    padding: 0 0 0 40px;
}

.container {
    background: #eee;
    margin: 50px;
    padding: 10px;
    border: 3px solid #000;
    display: flex;
    justify-content: space-around;
}

.item1 {
    background: #ff4500;
}

.item2 {
    background: #9acd32;
}

.item3 {
    background: #9370d8;
}

.item4 {
    background: #ff69b4;
}

.items {
    color: #ffffff;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    padding: 10px;
    margin: 5px;
}




Comments