Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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

Save Automatically?

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"/>
    <title>Responsive Web Design Task: Task</title>
    <link rel="stylesheet" href="styles/musvette.css"/>
    
    <meta name="viewport" content="width=device-width, initial-scale=1">
  </head>

  <body>

    <header>
      <div class="title">My Website</div>
      <nav>
        <ul>
          <li>
            <a href="">Link 1</a>
          </li>
          <li>
            <a href="">Link 2</a>
          </li>
          <li>
            <a href="">Link 3</a>
          </li>
        </ul>
      </nav>

    </header>

    <main>
      <article>
        <h1>This is the main heading</h1>
        <p>Veggies es bonus vobis, proinde vos postulo essum magis kohlrabi welsh onion daikon amaranth tatsoi tomatillo melon azuki bean garlic.</p>

        <p>Gumbo beet greens corn soko endive gumbo gourd. Parsley shallot courgette tatsoi pea sprouts fava bean collard greens dandelion okra wakame tomato. Dandelion cucumber earthnut pea peanut soko zucchini.</p>

        <ul class="cards">
          <li>
            <h2>Card One</h2>
            <div class="inner">
              <p>Turnip greens yarrow ricebean rutabaga endive cauliflower sea lettuce kohlrabi amaranth water spinach avocado.</p>
            </div>
          </li>
          <li>
            <h2>Card Two</h2>
            <div class="inner">
              <p>Daikon napa cabbage asparagus winter purslane kale. Celery potato scallion desert raisin horseradish spinach carrot soko.</p>
            </div>
          </li>
          <li>
            <h2>Card Three</h2>
            <div class="inner">
              <p>Lotus root water spinach fennel kombu maize bamboo shoot green bean swiss chard seakale pumpkin onion chickpea gram corn pea.</p>
            </div>
          </li>
          <li>
            <h2>Card Four</h2>
            <div class="inner">
              <p>Lotus root water spinach fennel kombu maize bamboo shoot green bean swiss chard seakale pumpkin onion chickpea gram corn pea.</p>
            </div>
          </li>
          <li>
            <h2>Card Five</h2>
            <div class="inner">
              <p>Nori grape silver beet broccoli kombu beet greens fava bean potato quandong celery. Bunya nuts black-eyed pea prairie turnip leek lentil turnip greens parsnip.</p>
            </div>
          </li>

        </ul>
      </article>
      <aside class="sidebar">
        <p>Have you discovered all of the other excellent content on this website?</p>

      </aside>
    </main>

  </body>

</html>
              
            
!

CSS

              
                * {
    box-sizing: border-box;
  }

  html {
    font: 1.2em/1.4 Arial, Helvetica, sans-serif;
  }

  body {
    padding: 0 0 1em;
  }

  header {
    background-color: #333;
    color: #fff;
    border: 5px solid #000;
  }

  header ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  header a {
    color: #fff;
    text-decoration: none;
    display: block;
    padding: 0.5em 1em;
    border-top: 1px solid #999;
  }

  header .title {
    font-size: 150%;
    font-style: italic;
    font-weight: bold;
    padding: 1em;
  }

  main {
    padding: 0 1em;
  }

  .cards {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .cards li {
    border: 5px solid #000;
    margin-bottom: 1em;
  }

  .cards h2 {
    background-color: #333;
    color: #fff;
    margin: 0;
    padding: 0.5em 1em;
  }

  .cards .inner {
    padding: 0.5em 1em;
  }

  .sidebar {
    background-color: #333;
    border: 5px solid #000;
    padding: 0.5em 1em;
    color: #fff;
  }

  /** MY CODE GOES HERE **/
  /*
  NOTE: The exercise is completed in order
  not to use any media queries and to use 
  CSS feautres only! */

  /* Body is GRID-ROW to align footer and header 
     background areas to grow or shrink as appropriate */
  body{
    display:grid;
    grid-template-rows: 1fr 12fr;
  }

  /* Top Header divided into 2 cols */
  header{
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(200px,1fr));
  }

  
  nav {
    display: flex;
    align-items: center ;
    justify-content: flex-end;
    margin: 0;
    padding: 0;
  }

  /* The Unordered List is also a FlexBox to 
    wrap the links and have a horizontal list */
  nav ul{
    display: flex;
    flex-wrap: wrap;
  }

  nav ul a{
    border: none;
    text-align: end;
  }

  /* FlexBox used instead of Grid for easier
     wrapping */
  main{
    display: flex;
    column-gap: 10px;
    flex-wrap: wrap;
    margin: 10px 0;
  }
  
  article{
    flex: 3;
    min-width: 450px;
  }

  .cards{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px,1fr));
    gap: 10px;
  }

  .sidebar{
    flex: 1;
    flex-shrink: 2;
    min-width: 300px;
  }
              
            
!

JS

              
                
              
            
!
999px

Console