Getting Started with Flexbox: Easy Layouts with HTML and CSS - 01



Hello Developers, We love using HTML to make websites look great and organized. Whether you're new and want to learn the basics or you're experienced and need some ideas, you're in the right place. Making a responsive website with HTML Flexbox layout needs to look good. Using specific HTML tags and a tidy design can make it easier for people to use and access. CSS helps add style and makes it look nice. Our Flexbox layout makes sure your website looks good on any device. You can change things to fit what you like. By choosing colors, fonts, and spacing carefully, you can make a Flexbox layout that grabs attention and makes your website special.

How to Day 1: "Getting Started with Flexbox: Easy Layouts with HTML and CSS.[Source Code]

To make this website, you would like to make two files: an HTML file, a CSS file. First, create an HTML file with the name of index.html and remember, you have to create a file with a .html extension.

<!DOCTYPE html> <html lang="en"> <head> <title>Responsive Flexbox Layout Using HTML & CSS</title> <meta name="description" content="Responsive layout Using HTML & CSSt. Made by learningrobo.com"> <meta name="author" content="learningrobo.com"> <meta name="keywords" content="layout,responsive,learningrobo.com,html & css projects,project,flexbox"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="icon" type=image/x-icon href="#"> <meta charset="UTF-8"> <link rel="stylesheet" href="Style.css"> <script src="https://kit.fontawesome.com/5d72166fb5.js" crossorigin="anonymous"></script> </head> <body> <!--Hello Future Developer Thanks for Using learningrobo.com, Share & Support us--> <div class="mp"> <div class="p1"> <h2>Header</h2> </div> <div class="p2"> <div class="p2c1"> <h2>Side bar</h2> </div> <div class="p2c2"> <div class="p2c2g1"> <h2>Content-1</h2> </div> <div class="p2c2g2"> <div class="p2c2g2-1"> <h2>Content-2</h2> </div> <div class="p2c2g2-2"> <h2>Content-3</h2> </div> </div> </div> </div> <div class="p3"> <h2>Footer</h2> </div> </div> <div class="credit">Made with <span>❤ </span>by<a href="https://www.learningrobo.com/"> learningrobo</a></div> <!--Check our website Regularly For New Snippets Post--> </body> </html>
CSS provides style to an HTML page. To make the page attractive create a CSS file with the name style.css and remember that you have to make a file with a .css extension.


@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap');
*{
    box-sizing: border-box;
}
body{
    margin: 0px;
}
.mp{
    display: flex;
    flex-wrap: wrap;
    width: calc(100vw-10px);
    height: 100vh;
    background-color: rgb(66, 62, 62);
    padding: 10px;
    gap:10px;
    font-family: "Roboto Mono", monospace;
    font-optical-sizing: auto;
}
.p1,.p3{
    display: flex;
    width: 100%;
    height: 19%;
    align-items: center;
    justify-content: center;
    background-color: rgb(77, 77, 165);
    border-color: black;
    border-style: solid;
    border-width: 5px;
}
.p2{
    display: flex;
    width: 100%;
    height: 60%;
    gap:10px;
}
.p2c1{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 30%;
    height: 100%;
    background-color: rgb(93, 201, 186);
    border-color: black;
    border-style: solid;
    border-width: 5px;
}
.p2c2{
    display: flex;
    flex-wrap: wrap;
    width: 70%;
    height: 98.4%;
    gap:10px;
}
.p2c2g1{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 50%;
    background-color: rgb(79, 79, 211);
    border-color: black;
    border-style: solid;
    border-width: 5px;
}
.p2c2g2{
    display: flex;
    width: 100%;
    height: 50%;
    gap:10px;
}
.p2c2g2 > div{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50%;
    height: 100%;
    background-color: rgb(79, 79, 211);
    border-color: black;
    border-style: solid;
    border-width: 5px;
}
@media screen and (max-width:1024px) {
    .container{
        width: calc(100vw-10px);
        height: 100vh;
    }
    .p2{
        flex-direction: column;
    }
    .p2c2g2{
        height: 47%;
    }
    .p2 div{
        width: 100%;
    }
    .p1,.p2{
        height: calc(20%-10px);
    }
}
@media screen and (max-width:630px) {
    .p2,.p2c2g2,.p2c2g2-1,.p2c2g2-1{
        flex-direction: column;
    }
    .p2 div{
        width: 100%;
    }
    .mp{
        height: 180vh;
    }
}
.credit a {
    text-decoration: none;
    color: #121212;
    font-weight: 800;
}
  
.credit {
    color: #121212;
    text-align: center;
    margin-top: 10px;
    font-family: Verdana,Geneva,Tahoma,sans-serif;
}
.credit span{
    color:#000;
    font-size:20px;
}     
We hope you would like this Flexbox Layout Using HTML and CSS.

Thank you for reading our blog. If you face any problem in Creating a Flexbox Layout Using HTML and CSS., then contact us or comment to us. We’ll try to provide a solution to your problem as soon as possible.

Press The Key ' p ' and say ' read article ' our voice assistant read our article.
In Our older post it doesnot work we working on that.

Thank you
Learning robo team

Post a Comment

Thank you
Learning robo team

Post a Comment (0)

Previous Post Next Post
Learning Robo says...
code copied
Welcome