Skip to content

CSS Calendar

HTML CODE:

<!DOCTYPE html>
<html>
<head>
    <title>page</title>
     <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <link rel="stylesheet" type="text/css" href="1.page.css">
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css">
</head>
<body>

    <div class="calendar">
        <div class="image">
            <h2>17, Thursday</h2>
            <h3>Novembe 2018</h3>
        </div>
        <div class="date">
            <div class="day">S</div>
            <div class="day">M</div>
            <div class="day">T</div>
            <div class="day">W</div>
            <div class="day">T</div>
            <div class="day">F</div>
            <div class="day">S</div>
            <div class="number"></div>
            <div class="number"></div>
            <div class="number"></div>
            <div class="number"></div>
            <div class="number">1</div>
            <div class="number">2</div>
            <div class="number">3</div>
            <div class="number">4</div>
            <div class="number">5</div>
            <div class="number">6</div>
            <div class="number">7</div>
            <div class="number">8</div>
            <div class="number">9</div>
            <div class="number">10</div>
            <div class="number">11</div>
            <div class="number">12</div>
            <div class="number">13</div>
            <div class="number">14</div>
            <div class="number">15</div>
            <div class="number">16</div>
            <div class="number active">17</div>
            <div class="number">18</div>
            <div class="number">19</div>
            <div class="number">20</div>
            <div class="number">21</div>
            <div class="number">22</div>
            <div class="number">23</div>
            <div class="number">24</div>
            <div class="number">25</div>
            <div class="number">26</div>        
            <div class="number">27</div>
            <div class="number">28</div>
            <div class="number">29</div>
            <div class="number">30</div>
        </div>
    </div>

</body>
</html>

CSS CODE:

@import url('https://fonts.googleapis.com/css?family=Poppins:300,400,600');
body{
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: url(https://images.pexels.com/photos/1072179/pexels-photo-1072179.jpeg?auto=compress&cs=tinysrgb&h=750&w=1260);
    background-size: cover;
    font-family: "Poppins" , sans-serif
}
.calendar{
    width: 300px;
    height: auto;
    background: #fff;
    box-sizing: border-box;
    box-shadow: 0 5px 50px rgba(0,0,0,.5)
}
.calendar .image{
    width: 100%;
    height: 200px;
    background: url(https://images.pexels.com/photos/257840/pexels-photo-257840.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260);
    background-size: cover;
    padding: 20px;
    box-sizing: border-box;
}
h2, h3{
    margin: 0;
    padding: 0;
    color: #fff;
    text-shadow: 0 2px 2px rgba(0,0,0,.2)
}
h3{
    font-weight: 500
}
.calendar .date{
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(25px,1fr));
    grid-gap: 10px;
    box-sizing: border-box;
}
.calendar .date div{
    display: flex;
    justify-content: center;
    align-items: center;
    height: 25px;
    color: #262626;
}
.calendar .date div.day{
    font-weight: 700;
}
.calendar .date div.day:first-child,
.calendar .date div.number:nth-child(7n + 1){
    color: #ff685d;
    font-weight: 700;
}
.calendar .date div.number.active,
.calendar .date div.number:hover{
    background: #009688;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: