Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>responsive-Layout</title>
  <style>
    * {
      padding: 0;
      margin: 0;
    }

    #container {
      border: solid black;
      padding: 15px;
      width: 1200px;
      margin: 0px auto;
    }

    /* 
1. 1201 or ---
2. 1025 to 1200
3. 769 to 1024
4. 481 tp 768
5. 0  to  480  
*/

    @media (min-width: 1201px) {
      #header {
        background-color: lightgrey;
        height: 70px;
        margin-bottom: 15px;
        border-radius: 15px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 40px;
        color: white;
      }

      #content {
        /* border: 5px solid red; */
      }

      #content::after {
        content: '';
        display: block;
        clear: both;
      }

      #left-sidebar {
        width: 20%;
        /* height: 515px; */
        /* border: solid blue; */
        float: left;
      }

      #nav {
        width: 100%;
        height: 400px;
        background-color: blueviolet;
        margin-bottom: 15px;
        border-radius: 15px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 40px;
        color: white;
      }

      #news {
        width: 100%;
        height: 300px;
        background-color: orangered;
        border-radius: 15px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 40px;
        color: white;
      }

      #right-sidebar {
        width: 78%;
        height: 715px;
        /* border: solid green; */
        float: right;
        background-color: goldenrod;
        border-radius: 15px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 40px;
        color: white;
      }

      #footer {
        background-color: lightblue;
        height: 70px;
        margin-top: 15px;
        border-radius: 15px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 40px;
        color: white;
      }
    }

    /* Breakpoint-2  */

    @media (min-width: 1025px) and (max-width: 1200px) {
      #header {
        background-color: lightgrey;
        height: 70px;
        margin-bottom: 15px;
        border-radius: 15px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 40px;
        color: white;
      }

      #content {
        /* border: 5px solid red; */
      }

      #content::after {
        content: '';
        display: block;
        clear: both;
      }

      #left-sidebar {
        width: 20%;
        /* height: 515px; */
        /* border: solid blue; */
        float: left;
        display: flex;
        flex-direction: column;
      }

      #nav {
        order: 2;
        width: 100%;
        height: 400px;
        background-color: blueviolet;
        /* margin-bottom: 15px; */
        border-radius: 15px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 40px;
        color: white;
      }

      #news {
        order: 1;
        width: 100%;
        height: 300px;
        background-color: orangered;
        border-radius: 15px;
        margin-bottom: 15px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 40px;
        color: white;
      }

      #right-sidebar {
        width: 78%;
        height: 715px;
        /* border: solid green; */
        float: right;
        background-color: goldenrod;
        border-radius: 15px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 40px;
        color: white;
      }

      #footer {
        background-color: lightblue;
        height: 70px;
        margin-top: 15px;
        border-radius: 15px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 40px;
        color: white;
      }
    }

    /* Breakpoint-3  */

    @media (min-width: 769px) and (max-width: 1024px) {
      #header {
        background-color: lightgrey;
        height: 70px;
        margin-bottom: 15px;
        border-radius: 15px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 40px;
        color: white;
      }

      #content {
        /* border: 5px solid red; */
      }

      #content::after {
        content: '';
        display: block;
        clear: both;
      }

      #left-sidebar {
        width: 20%;
        /* height: 515px; */
        /* border: solid blue; */
        float: left;
        display: flex;
        flex-direction: column;
      }

      #nav {
        order: 2;
        width: 100%;
        height: 715px;
        background-color: blueviolet;
        /* margin-bottom: 15px; */
        border-radius: 15px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 40px;
        color: white;
      }

      #news {
        display: none;
      }

      #right-sidebar {
        width: 78%;
        height: 715px;
        /* border: solid green; */
        float: right;
        background-color: goldenrod;
        border-radius: 15px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 40px;
        color: white;
      }

      #footer {
        background-color: lightblue;
        height: 70px;
        margin-top: 15px;
        border-radius: 15px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 40px;
        color: white;
      }
    }

    /* Breakpoint-4  */

    @media (min-width: 481px) and (max-width: 768px) {
      #header {
        background-color: lightgrey;
        height: 70px;
        margin-bottom: 15px;
        border-radius: 15px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 40px;
        color: white;
      }

      #content {
        /* border: 5px solid red; */
        display: flex;
        flex-direction: column;
      }

      #left-sidebar::after {
        content: '';
        display: block;
        clear: both;
      }

      #left-sidebar {
        order: 2;
        width: 100%;
        /* height: 515px; */
        /* border: solid blue; */
        /* float: left; */
        /* display: flex; */
        /* flex-direction: row; */
      }

      #nav {
        order: 2;
        width: 50%;
        float: left;
        height: 100px;
        background-color: blueviolet;
        /* margin-bottom: 15px; */
        border-radius: 15px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 40px;
        color: white;
      }

      #news {
        /* order: 1; */
        width: 48%;

        float: right;
        height: 100px;
        background-color: orangered;
        border-radius: 15px;
        /* margin-right: 15px; */
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 40px;
        color: white;
      }

      #right-sidebar {
        order: 1;
        width: 100%;
        height: 715px;

        /* border: solid green; */
        /* float: right; */
        background-color: goldenrod;
        border-radius: 15px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 40px;
        color: white;
        margin-bottom: 15px;
      }

      #footer {
        background-color: lightblue;
        height: 70px;
        margin-top: 15px;
        border-radius: 15px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 40px;
        color: white;
      }
    }

    /* Breakpoint-5  */

    @media (max-width: 480px) {
      #header {
        background-color: lightgrey;
        height: 70px;
        margin-bottom: 15px;
        border-radius: 15px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 40px;
        color: white;
      }

      #content {
        /* border: 5px solid red; */
        display: flex;
        flex-direction: column;
      }

      #left-sidebar::after {
        content: '';
        display: block;
        clear: both;
      }

      #left-sidebar {
        order: 2;
        width: 100%;
        /* height: 515px; */
        /* border: solid blue; */
        /* float: left; */
        /* display: flex; */
        /* flex-direction: row; */
      }

      #nav {
        order: 2;
        width: 100%;
        /* float: left; */
        height: 200px;
        background-color: blueviolet;
        margin-bottom: 15px;
        border-radius: 15px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 40px;
        color: white;
      }

      #news {
        /* order: 1; */
        width: 100%;

        /* float: right; */
        height: 200px;
        background-color: orangered;
        border-radius: 15px;

        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 40px;
        color: white;
      }

      #right-sidebar {
        order: 1;
        width: 100%;
        height: 300px;

        /* border: solid green; */
        /* float: right; */
        background-color: goldenrod;
        border-radius: 15px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 40px;
        color: white;
        margin-bottom: 15px;
      }

      #footer {
        background-color: lightblue;
        height: 70px;
        margin-top: 15px;
        border-radius: 15px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 40px;
        color: white;
      }
    }
  </style>
</head>

<body>
  <div id="container">
    <div id="header">Header</div>
    <div id="content">
      <div id="left-sidebar">
        <div id="nav">Navigation</div>
        <div id="news">News Updates</div>
      </div>
      <div id="right-sidebar">Main Content</div>
    </div>
    <div id="footer">Footer</div>
  </div>
</body>

</html>
              
            
!

CSS

              
                
              
            
!

JS

              
                
              
            
!
999px

Console