
Want to learn how to create a website with HTML and CSS ?
You're in the place. In this guide, We display you all the steps to get from a blank display to a working internet site that's optimized and quite good-looking at the same time.
HTML Coding
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <link rel="stylesheet" type="text/css" href="/test.css">
- <title>Opening Hours Cards With Html and CSS</title>
- </head>
- <body>
- <div class="opening-hours-container">
- <div class="left-col">
- <div class="card">
- <div class="content">
- <i data-feather="calender"></i>
- <span> Monday - Friday </span>
- </div>
- <div class="content">
- <i data-feather="clock"></i>
- <span> 10:00 - 16:30 </span>
- </div>
- </div>
- <!-- <i>insert more .card here</i> -->
- <div>
- <div class="right-col">
- <div class="card" id="smart-card" data-status="soon">
- <div class="content">
- <i data-feather="clock"></i>
- <span id="smart-status"> We'll close soon </span>
- </div>
- </div>
- </div>
- </div>
- </div>
- <script src="https://unpkg.com/feather-icons"></script>
- <script> feather.replace() </script>
- </body>
- </html>
End of HTML Coding. Now We'll Start CSS Coding.
CSS Coding
- .opening-hours-container {
- display: flex;
- }
- .right-col {
- margin-left: 100px;
- display: flex;
- align-items: center;
- }
- /* you can change the data-status attribute to (soon | open | close) */
- .card#smart-card[data-status="soon"] {
- background: #F2811E;
- box-shadow: 0 12px 84px #d6ad88;
- color: #fff;
- }
- .card#smart-card[data-status="open"] {
- background: #lef28f;
- box-shadow: 0 12px 84px #88d6b8;
- color: #121212;
- }
- .card#smart-card[data-status="close"] {
- background: #f21e41;
- box-shadow: 0 12px 84px #d68892;
- color: #fff;
- }
- .card {
- min-width: 375px;
- display: grid;
- grid-template-columns: 250px auto;
- padding: 32px;
- border-radius: 8px;
- font-family: 'Circular Std Book' , sans-serif;
- color: #121212;
- box-shadow: 0 12px 84px rgba(189, 196, 214, .5);
- user-select: none;
- }
- .card#smart-card, .card#smart-card .content {
- justify-content: center;
- }
- .card:not(:last-child) {
- margin-bottom: 24px;
- }
- .card svg {
- height: 24px;
- }
- .card .feather-calendar {
- margin-top: -3px;
- }
- .card .content {
- display: flex;
- align-items: center;
- }
- .card .content span {
- margin-left: 8px;
- }
Now CSS Coding is also complete.
The last thing we have to do is to save and run the Code and get the output.
So guys run the code in your IDE's and you will get the following output.
Output Screen-shot of the above coding
Hope this article helps you. If you have any suggestion Drop it in Comment Section and Join Our Family by Clicking Subscribe Button and For More Article/Post Like this Join us on:-
Join Our Channels:- Free Online Course & Government / Private Jobs Links
Hope this article helps you. If you have any suggestion Drop it in Comment Section and Join Our Family by Clicking Subscribe Button and For More Article/Post Like this Join us on:-
No comments:
Post a Comment
Please do not enter spam link in the comment box.