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

              
                
<link href='https://fonts.googleapis.com/css?family=Pacifico' rel='stylesheet' type='text/css'>

<!-- Chupa-Chupsy Candy -->
<div>
<div class="chupa-chups pink">
    <div class="floral-shape">
        <p>Chupa<br/>Chups</p>
    </div>
</div>
</div>

<div>
<div class="chupa-chups orange">
    <div class="floral-shape">
        <p>Chupa<br/>Chups</p>
    </div>
</div>
</div>


<div>
<div class="chupa-chups green">
    <div class="floral-shape">
        <p>Chupa<br/>Chups</p>
    </div>
</div>
</div>


<div>
<div class="chupa-chups blue">
    <div class="floral-shape">
        <p>Chupa<br/>Chups</p>
    </div>
</div>
</div>
              
            
!

CSS

              
                /**
* CSS3 No-image Chupa-Chupsy candy 
* by @girlie_mac 
* http://girliemac.com/blog/2012/03/24/making-chupa-chups-using-css3-pseudo-elements/
*
* Please, do not compare this with the real one ;-)
* I feel pretty terrible making the awesome design by Salvador Dalí into some crap.
* But my point of this demo is that you can create the floral shape with CSS, using border-radius:50% and pseudo-element(s)
*/
html {
    background: #444;
    background: linear-gradient(135deg, #555, #222);
    min-height: 100%;
    margin: 0;
    padding: 2em;
}
p {
    margin: 0;    
    padding: 0;
}
body > div {
    margin: 30px;
    display: inline-block;
}
.chupa-chups {
    width: 300px;
    height: 300px;
    border-radius: 50%;
}
.chupa-chups.orange {
    background: orange;
    background: -o-linear-gradient(325deg, gold 20%, orangered);
    background: -webkit-linear-gradient(325deg, gold 20%, orangered);
    background: -moz-linear-gradient(325deg, gold 20%, orangered);
    background: linear-gradient(325deg, gold 20%, orangered);
}
.chupa-chups.green {
    background: green;
    background: -o-linear-gradient(325deg, YellowGreen 20%, darkgreen);
    background: -moz-linear-gradient(325deg, YellowGreen 20%, darkgreen);
    background: -webkit-linear-gradient(325deg, YellowGreen 20%, darkgreen);
    background: linear-gradient(325deg, YellowGreen 20%, darkgreen);
}
.chupa-chups.pink {
    background: HotPink;
    background: -o-linear-gradient(325deg, HotPink 20%, FireBrick);
    background: -moz-linear-gradient(325deg, HotPink 20%, FireBrick);
    background: -webkit-linear-gradient(325deg, HotPink 20%, FireBrick);
    background: linear-gradient(325deg, HotPink 20%, FireBrick);
}
.chupa-chups.blue {
    background: MediumBlue;
    background: -o-linear-gradient(325deg, RoyalBlue 20%, MediumBlue);
    background: -moz-linear-gradient(325deg, RoyalBlue 20%, MediumBlue);
    background: -webkit-linear-gradient(325deg, RoyalBlue 20%, MediumBlue);
    background: linear-gradient(325deg, RoyalBlue 20%, MediumBlue);
}
.chupa-chups p {
    z-index: 1;
    position: absolute;
    top: 26px; left: 10px;
    color: #ce1141;
    font-family: Pacifico, cursive;
    font-size: 68px;
    line-height: 70px;
    text-align: center;
    text-shadow: 1px 2px 0 #fff;
}
.floral-shape,  
.floral-shape::before, 
.floral-shape::after {
    width: 200px;       
    height: 200px;
    border-radius: 25%;
    border: 6px solid #ce1141;
    background: yellow;
    background: -o-linear-gradient(325deg, yellow 30%, orange);
    background: -moz-linear-gradient(325deg, yellow 30%, orange);
    background: -webkit-linear-gradient(30deg, yellow 30%, orange);
    background: linear-gradient(60deg, yellow 30%, orange);
}
.floral-shape {
    position: relative;
    top: 42px;
    left: 42px;
}
.floral-shape::before {
    content: "";
    position: absolute;
    top: -3px; left: -3px; /* adjust for the border-width */
    background: -o-linear-gradient(375deg, yellow 30%, orange);
    background: -moz-linear-gradient(375deg, yellow 30%, orange);
    background: -webkit-linear-gradient(375deg, yellow 30%, orange);
    background: linear-gradient(375deg, yellow 30%, orange);
    -o-transform: rotate(45deg);
    -moz-transform: rotate(45deg);
    -webkit-transform: rotate(45deg);
    transform: rotate(45deg);
}
.floral-shape::after {
    content: "";
    position: absolute;
    border: 0 none;
    box-shadow: none;
}

              
            
!

JS

              
                
              
            
!
999px

Console