123

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <!doctype html>
<html lang="en">
    <head>
        <title>Nutrition Facts Label</title>
    </head>
    <body>
        <header>
            <h1 class="main-heading heading">Nutrition Facts</h1>
        </header>
        <main>
            <div class="servings">
                <h2 class="servings-heading heading">Servings</h2>
                <div class="servings-per-container">
                    <span class="attribute">Servings Per Container</span>
                    <span class="value">8</span>
                </div>
                <div class="serving-size">
                    <span class="attribute">Serving Size</span>
                    <span class="value">
                        <span class="cup-unit">2/3 cup</span>
                        <span class="or-preposition">or</span>
                        <span class="gram-unit">55g</span>
                    </span>
                </div>
            </div>
            <div class="daily-values">
                <h2 class="daily-values-heading heading">Daily Values</h2>
                <div class="percent-daily-value-label">% Daily Value*</div>
                <ul>
                    <li class="calories">
                        <div class="heading">Calories</div>
                        <div class="amount-per-serving">
                            <span class="attribute">Amount Per Serving</span>
                            <span class="value">230</span>
                        </div>
                    </li>
                    <li class="total-fat">
                        <div class="total-fat---cr">
                            <div class="heading">Total Fat</div>
                            <div class="amount-per-serving">
                                <span class="attribute">Amount Per Serving</span>
                                <span class="value">8g</span>
                            </div>
                            <div class="percent-daily-value">
                                <span class="attribute">% Daily Value</span>
                                <span class="value">10%</span>
                            </div>
                        </div>
                        <ul>
                            <li class="saturated-fat">
                                <div class="heading">Saturated Fat</div>
                                <div class="amount-per-serving">
                                    <span class="attribute">Amount Per Serving</span>
                                    <span class="value">1g</span>
                                </div>
                                <div class="percent-daily-value">
                                    <span class="attribute">% Daily Value</span>
                                    <span class="value">5%</span>
                                </div>
                            </li>
                            <li class="trans-fat">
                                <div class="heading">Trans Fat</div>
                                <div class="amount-per-serving">
                                    <span class="attribute">Amount Per Serving</span>
                                    <span class="value">0g</span>
                                </div>
                                <div class="percent-daily-value">
                                    <span class="attribute">% Daily Value</span>
                                    <span class="value">0%</span>
                                </div>
                            </li>
                        </ul>
                    </li>
                    <li class="cholesterol">
                        <div class="heading">Cholesterol</div>
                        <div class="amount-per-serving">
                            <span class="attribute">Amount Per Serving</span>
                            <span class="value">0mg</span>
                        </div>
                        <div class="percent-daily-value">
                            <span class="attribute">% Daily Value</span>
                            <span class="value">0%</span>
                        </div>
                    </li>
                    <li class="sodium">
                        <div class="heading">Sodium</div>
                        <div class="amount-per-serving">
                            <span class="attribute">Amount Per Serving</span>
                            <span class="value">160mg</span>
                        </div>
                        <div class="percent-daily-value">
                            <span class="attribute">% Daily Value</span>
                            <span class="value">7%</span>
                        </div>
                    </li>
                    <li class="total-carbohydrate">
                        <div class="total-carbohydrate---cr">
                            <div class="heading">Total Carbohydrate</div>
                            <div class="amount-per-serving">
                                <span class="attribute">Amount Per Serving</span>
                                <span class="value">37g</span>
                            </div>
                            <div class="percent-daily-value">
                                <span class="attribute">% Daily Value</span>
                                <span class="value">13%</span>
                            </div>
                        </div>
                        <ul>
                            <li class="dietary-fiber">
                                <div class="heading">Dietary Fiber</div>
                                <div class="amount-per-serving">
                                    <span class="attribute">Amount Per Serving</span>
                                    <span class="value">4g</span>
                                </div>
                                <div class="percent-daily-value">
                                    <span class="attribute">% Daily Value</span>
                                    <span class="value">14%</span>
                                </div>
                            </li>
                            <li class="total-sugars">
                                <div class="total-sugars---cr">
                                    <div class="heading">Total Sugars</div>
                                    <div class="amount-per-serving">
                                        <span class="attribute">Amount Per Serving</span>
                                        <span class="value">12g</span>
                                    </div>
                                    <div class="percent-daily-value">
                                        <span class="attribute">% Daily Value</span>
                                        <span class="value">20%</span>
                                    </div>
                                </div>
                                <div class="added-sugars-note">Includes 10g Added Sugars</div>
                            </li>
                        </ul>
                    </li>
                    <li class="protein">
                        <div class="heading">Protein</div>
                        <div class="amount-per-serving">
                            <span class="attribute">Amount Per Serving</span>
                            <span class="value">3g</span>
                        </div>
                    </li>
                </ul>
            </div>
            <div class="nutrients-declaration-requirement">
                <h2 class="heading nutrients-declaration-requirement-heading">Nutrients Declaration Requirement</h2>
                <ul>
                    <li class="vitamin-d">
                        <div class="heading">Vitamin D</div>
                        <div class="amount-per-serving">
                            <span class="attribute">Amount Per Serving</span>
                            <span class="value">2mcg</span>
                        </div>
                        <div class="percent-daily-value">
                            <span class="attribute">% Daily Value</span>
                            <span class="value">10%</span>
                        </div>
                    </li>
                    <li class="calcium">
                        <div class="heading">Calcium</div>
                        <div class="amount-per-serving">
                            <span class="attribute">Amount Per Serving</span>
                            <span class="value">260mcg</span>
                        </div>
                        <div class="percent-daily-value">
                            <span class="attribute">% Daily Value</span>
                            <span class="value">20%</span>
                        </div>
                    </li>
                    <li class="iron">
                        <div class="heading">Iron</div>
                        <div class="amount-per-serving">
                            <span class="attribute">Amount Per Serving</span>
                            <span class="value">8g</span>
                        </div>
                        <div class="percent-daily-value">
                            <span class="attribute">% Daily Value</span>
                            <span class="value">45%</span>
                        </div>
                    </li>
                    <li class="potassium">
                        <div class="heading">Potassium</div>
                        <div class="amount-per-serving">
                            <span class="attribute">Amount Per Serving</span>
                            <span class="value">235mg</span>
                        </div>
                        <div class="percent-daily-value">
                            <span class="attribute">% Daily Value</span>
                            <span class="value">6%</span>
                        </div>
                    </li>
                </ul>
            </div>
        </main>
        <footer>
            <div class="daily-value-note">* The % Daily Value (DV) tells you how much a nutrient in a serving of food contributes to a daily diet. 2,000 calories a day is used for general nutritional advice.</div>
        </footer>
    </body>
</html>
            
          
!
            
              body {
    /* Layout */
    margin: 0;
}

.amount-per-serving {
    
    .attribute {
        /* Layout */
        display: none;
    }
}

.percent-daily-value {
    
    .attribute {
        /* Layout */
        display: none;
    }
}

.servings-heading {
        /* Layout */
    display: none;
}

.daily-values-heading {
        /* Layout */
    display: none;
}

.nutrients-declaration-requirement-heading {
    /* Layout */
    display: none;
}

.daily-values,
.nutrients-declaration-requirement {
    
    ul {
        /* Layout */
        list-style: none;
        margin: 0;
        padding: 0;
    }
    
    li {
        /* Layout */
        display: flex;
        
        .heading {
            /* Layout */
            display: flex;
            white-space: nowrap;
        }
    }
    
    .percent-daily-value {
        /* Layout */
        text-align: right;
    }
    
    .amount-per-serving {
        /* Layout */
        flex: 1 100%;
        margin: 0 .5em;
    }

    .total-fat {
        /* Layout */
        display: block;
    }
    
    .total-fat---cr {
        /* Layout */
        display: flex;
    }
    
    .total-carbohydrate {
        /* Layout */
        display: block;
    }
    
    .total-carbohydrate---cr {
        /* Layout */
        display: flex;
    }
    
    .total-sugars {
        /* Layout */
        display: block;
    }
    
    .total-sugars---cr {
        /* Layout */
        display: flex;
    }
}

.saturated-fat {
    /* Layout */
    margin-left: 1em;
}

.trans-fat {
    /* Layout */
    margin-left: 1em;
}

.dietary-fiber {
    /* Layout */
    margin-left: 1em;
}

.total-sugars {
    /* Layout */
    margin-left: 1em;
}

.added-sugars-note {
    /* Layout */
    margin-left: 1em;
}

.serving-size {
    /* Layout */
    display: flex;
    
    .attribute {
        /* Layout */
        white-space: nowrap;
    }
    
    .value {
        /* Layout */
        flex: 1 100%;
        text-align: right;
    }
}

.servings-per-container {
    /* Layout */
    display: flex;
    
    .value {
        /* Layout */
        margin-right: .25em;
    }
    
    .attribute {
        /* Layout */
        order: 1;
    }
}

.percent-daily-value-label {
    /* Layout */
    text-align: right;
}

.calories {
    /* Layout */
    display: flex;
    
    .amount-per-serving {
        /* Layout */
        flex: 1 100%;
        margin: 0;
        text-align: right;
    }
}

.main-heading {
    /* Layout */
    margin: 0;
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console