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





























Hello Developers, We're passionate about using HTML to create visually appealing and well-organized web layouts. Whether you're new to coding and want to learn the basics or an experienced developer seeking inspiration, you're in the right place. Creating a visually attractive HTML Flexbox layout for a responsive website is crucial. By using semantic HTML tags and a structured design, we can improve usability and accessibility. CSS is key for adding styling to enhance the overall appearance. Our responsive HTML Flexbox layout ensures optimal display on all devices. You have the flexibility to customize and adjust the layout to your preferences and needs. By carefully selecting colors, fonts, and spacing, you can create an eye-catching Flexbox layout that grabs visitors' attention and makes your website stand out.

How to make 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 & CSS. 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="Styles.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="container"> <div class="p1"> <span>Header</span> </div> <div class="p2"> <div class="s1"> <div class="d1"> <span>Menu</span> </div> <div class="d2"> <span>AD1</span> </div> </div> <div class="s2"> <span>Main</span> </div> <div class="s3"> <span>AD2</span> </div> </div> <div class="p3"> <span>Footer</span> </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=Hind:wght@300;400;500;600;700&display=swap');
*{
    box-sizing: border-box;
}
.container{
    margin:0 ;
    padding: 0;
    background-color:rgb(0, 0, 0) ;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    flex-direction: column;
}
.p1{
    height: 16%;
    width: 100%;
    background-color: aqua;
}
.p2{
    height: 60%;
    width: 100%;
    background-color: black;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}
.p3{
    height: 16%;
    width: 100%;
    background-color: red;
}
.s1{
    height: 100%;
    width: 20%;
    flex-direction:column ;
    display: flex;
    justify-content:space-between ;
}
.s2{
    height: 100%;
    width: 58%;
    background-color: aquamarine;
}
.s3{
    height: 100%;
    width:20%;
    background-color: blanchedalmond;
}
.p1,.p3,.s2,.s3{
    display: flex;
    justify-content: center;
    align-items: center;
}
.d1{
    height: 58%;
    width: 100%;
    background-color: aquamarine;
}
.d2{
    height: 39%;
    width: 100%;
    background-color:honeydew ;
}
.d1,.d2{
    display: flex;
    justify-content: center;
    align-items: center;
}
@media only screen and (max-width: 860px){
    .container{
        height: 770px;
        width: auto;
        justify-content: space-evenly;
    }
    .p1,.p3{
        height: 100px;
        width: 100%;
    }
    .p2{
        height:540px;
        width: 100%;
        justify-content: space-evenly;
    }
    .s1{
        height: 200px;
        width: 100%;
        flex-direction: row;
    }
    .d1,.d2{
        width: 49%;
        height: 100%;
    }
    .s2,.s3 {
        height: 150px;
        width: 100%;
    }
}
@media only screen and (max-width: 550px){
    .container{
        height: 800px;
    }
    .p2{
        height: 650px;
        width: 100%;
        justify-content: space-evenly;
    }
    .s1{
        flex-direction: column;
        justify-content: space-around;
        height: 60%;
        width: 100%;
    }
    .d1,.d2{
        height: 80%;
        width: 100%;
    }
}
.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;
}     
.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 Getting Started with Flexbox: Easy Layouts with 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