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=Raleway:400,600' rel='stylesheet' type='text/css'>

<div class="contain-demo">
    <!-- SVG and apple text both cozy in h2 element -->
    <h2>
      <svg class="icon" width="100px" height="100px" viewBox="0 0 100 100">
        <g>
          <path d="M81.4,58.202c-1.628,1.386-4.211,2.925-7.874,2.925c-3.65,0-6.223-1.524-7.847-2.904c-1.63,1.38-4.205,2.904-7.845,2.904
      c-3.634,0-6.204-1.514-7.826-2.892c-1.622,1.378-4.19,2.892-7.826,2.892c-3.646,0-6.219-1.524-7.845-2.91
      c-1.632,1.386-4.205,2.91-7.845,2.91c-3.684,0-6.273-1.555-7.897-2.944c-1.634,1.282-3.946,2.439-7.044,2.842l7.221,12.981h62.204
      l5.943-13.261C84.917,60.356,83.034,59.597,81.4,58.202z"/>
          <path d="M98.105,50.717c-0.559-1.536-1.664-2.314-3.294-2.314c-1.203,0-2.312,0.457-2.983,0.938
      c-6.976-13.619-26.595-23.347-42.055-23.347c-14.543,0-34.49,9.754-41.511,23.401c-0.653-0.504-1.818-0.992-3.071-0.992
      c-1.626,0-2.735,0.778-3.296,2.314c-0.555,1.52-0.367,2.962,0.559,4.284c1.568,2.251,4.91,3.644,8.12,3.359
      c3.275-0.332,5.214-1.862,6.265-3.083l1.809-2.112l1.812,2.108c1.232,1.432,3.029,3.069,6.033,3.069
      c2.996,0,4.797-1.641,6.035-3.079l1.812-2.103l1.809,2.106c1.234,1.432,3.033,3.075,6.033,3.075c2.992,0,4.786-1.637,6.016-3.065
      l1.81-2.101l1.812,2.101c1.228,1.428,3.021,3.065,6.014,3.065c2.996,0,4.801-1.641,6.042-3.079l1.814-2.108l1.809,2.112	c1.224,1.432,3.019,3.075,6.027,3.075c3.002,0,4.805-1.641,6.039-3.075l1.741-1.947c0,0,2.879,4.757,7.814,5.003l0.713,0.062	c0.192,0.012,0.342,0.012,0.498,0.012c2.892,0,5.793-1.366,7.219-3.398C98.474,53.679,98.659,52.238,98.105,50.717z M39.384,37.985
      c-1.914,2.374-4.015,2.168-4.924,1.307c-0.957-0.903-1.24-2.95,1.028-4.989c2.231-2.018,5.748-2.181,5.748-2.181
      S41.271,35.644,39.384,37.985z M49.718,42.532c-1.332,0-3.113-1.37-2.856-4.611c0.254-3.194,2.856-5.891,2.856-5.891	s2.602,2.696,2.856,5.891C52.833,41.162,51.117,42.532,49.718,42.532z M64.441,39.292c-0.907,0.861-3.008,1.069-4.924-1.307
      c-1.885-2.341-1.851-5.864-1.851-5.864s3.517,0.163,5.746,2.181C65.685,36.34,65.4,38.389,64.441,39.292z"/>
        </g>
      </svg>
      Apple Pie
    </h2>   

    <h2>
      <svg class="icon" width="100px" height="100px" viewBox="0 0 100 100">
        <g id="Your_Icon">
          <path d="M71.184,40.741c3.633,2.451,5.313,4.971,6.579,9.263c0.253,0.848,0.431,2.145,0.266,3.093
      c-2.217-5.061-6.964-8.926-11.933-10.656c-5.512-1.919-11.483-1.244-15.586,0.313c-2.958,1.119-6.84,3.124-9.48,6.085	c4.818,1.082,8.214,2.511,11.269,7.141c0.737,1.124,0.634,1.836,0.994,2.618c-5.544-5.162-16.32-9.155-22.656-5.187
      c-6.762,3.898-9.63,10.034-8.503,14.719c2.239,9.326,19.928,7.105,41.183,1.997C84.574,65.021,101.2,58.996,99.1,49.637	C97.422,42.134,81.852,36.902,71.184,40.741z"/>
         <g>
          <path d="M29.01,50.7c2.206-1.366,4.852-2.06,7.863-2.06c0.001,0,0.001,0,0.002,0c0.033,0,0.064,0,0.098,0l1.697-1.903
        c3.376-3.786,8.168-5.972,10.719-6.938c2.145-0.814,4.568-1.353,7.012-1.574c-2.361-4.619-6.808-8.148-11.479-9.775
        c-5.513-1.918-11.483-1.243-15.586,0.313c-2.958,1.119-6.843,3.125-9.48,6.087c4.818,1.081,8.213,2.51,11.27,7.141	c0.736,1.122,0.633,1.836,0.993,2.618c-5.543-5.164-16.32-9.156-22.656-5.188C2.701,43.316-0.167,49.452,0.96,54.14	c1.382,5.761,8.668,7.114,19.042,6.102C21.632,56.569,24.756,53.162,29.01,50.7z"/>
          <path d="M56.589,36.013c0.178,0.599,0.311,1.419,0.322,2.183c0.662-0.049,1.327-0.089,1.984-0.089c2.562,0,5.026,0.354,7.34,1.055
        l3.878-1.395c2.411-0.868,5.079-1.334,7.925-1.437c-0.03-0.227-0.061-0.454-0.113-0.685c-1.678-7.501-17.247-12.735-27.916-8.895 C53.642,29.201,55.323,31.724,56.589,36.013z"/>
         </g>
        </g>
      </svg>
     Apple Bread
    </h2>   

     <h2>
      <svg class="icon" width="100px" height="100px" viewBox="0 0 100 100">
        <g>
          <path d="M62.931,38.028c-0.629-1.242-1.463-1.374-3.492-1.374c-0.062-0.001-0.124,0-0.186,0c-1.177,0-2.385-0.025-3.444-0.708
      c-0.56-0.36-1.11-0.829-1.693-1.325c-1.261-1.073-2.689-2.289-4.116-2.289s-2.854,1.216-4.116,2.289
      c-0.583,0.496-1.132,0.964-1.692,1.325c-1.103,0.711-2.359,0.716-3.588,0.708c-0.015,0-0.028,0-0.043,0
      c-2.029,0-2.863,0.133-3.529,1.464c-0.079,0.326,0.054,1.32,0.314,2.515c2.858-1.46,7.454-2.412,12.653-2.412	c5.196,0,9.789,0.951,12.647,2.409C62.904,39.423,63.03,38.405,62.931,38.028z"/>
          <path d="M9.035,55.907c1.12,0.15,3.155-0.246,5.121-0.629c3.363-0.656,6.84-1.329,9.222-0.173c2.239,1.09,4.176,3.747,6.229,6.562	c1.894,2.599,4.252,5.833,5.887,6.013c1.424,0.18,4.214-1.703,6.47-3.197c2.864-1.895,5.572-3.686,8.037-3.686v-0.02	c2.465,0,5.173,1.79,8.038,3.686c2.257,1.494,5.074,3.373,6.47,3.197c1.635-0.18,3.993-3.414,5.887-6.013
      c2.052-2.813,3.989-5.471,6.228-6.561c2.382-1.16,5.858-0.484,9.222,0.172c1.967,0.383,4,0.778,5.121,0.629
      c1.345-0.18,4.726-2.508,8.085-5.237c0.006-0.217,0.026-0.432,0.026-0.65c0-17.347-21.973-31.409-49.077-31.409	S0.923,32.653,0.923,50c0,0.225,0.02,0.446,0.027,0.669C4.309,53.399,7.692,55.728,9.035,55.907z M33.521,36.362
      c1.82-3.639,5.113-3.63,7.087-3.635c0.504,0,1.267,0.001,1.483-0.096c0.316-0.205,0.769-0.592,1.249-1
      c1.6-1.36,3.79-3.224,6.661-3.224s5.061,1.864,6.661,3.225c0.48,0.408,0.932,0.795,1.273,1.013	c0.192,0.084,0.954,0.081,1.459,0.082c1.951,0.005,5.267-0.004,7.087,3.635c0.978,1.957-0.095,5.985-0.845,8.275
      C64.922,47.643,58.2,50,50,50s-14.922-2.357-15.634-5.363C33.616,42.347,32.543,38.32,33.521,36.362z"/>
          <path d="M91.484,59.779c-1.756,0.237-4.007-0.203-6.388-0.667c-2.345-0.456-5.551-1.082-6.754-0.495
      c-1.359,0.662-3.172,3.149-4.773,5.342c-2.592,3.557-5.274,7.234-8.631,7.603c-0.194,0.021-0.389,0.031-0.586,0.031
      c-2.65,0-5.488-1.877-8.48-3.856c-2.044-1.352-4.588-3.034-5.872-3.034v0.02c-1.284,0-3.828,1.682-5.872,3.035
      c-2.993,1.98-5.83,3.856-8.48,3.856c-0.196,0-0.391-0.011-0.586-0.031c-3.357-0.369-6.038-4.046-8.631-7.603
      c-1.601-2.194-3.415-4.682-4.773-5.343c-1.202-0.584-4.411,0.039-6.754,0.496c-2.381,0.464-4.63,0.902-6.388,0.667
      c-1.704-0.228-4.175-1.693-6.575-3.411C6.553,70.672,26.317,81.409,50,81.409c23.698,0,43.471-10.75,48.068-25.046	C95.665,58.083,93.189,59.552,91.484,59.779z"/>
        </g>
      </svg>
      Apple Donut
     </h2>

     <h2>
      <svg class="icon" width="100px" height="100px" viewBox="0 0 100 100">
        <path d="M79.395,49.334c4.573-1.269,7.932-5.46,7.932-10.437c0-5.591-4.236-10.192-9.674-10.771c-1.61-3.597-4.671-6.4-8.439-7.668
    c-1.176-4.711-5.435-8.201-10.511-8.201c-4.819,0-8.901,3.148-10.308,7.499c-2.112-1.047-4.491-1.638-7.008-1.638
    c-6.822,0-12.635,4.322-14.85,10.378c-0.961-0.28-1.977-0.432-3.029-0.432c-5.983,0-10.833,4.85-10.833,10.833	c0,5.45,4.025,9.959,9.265,10.719v0.114h0.303c2.334,12.671,4.666,25.342,7,38.013c0,0,0,0,0.001,0h-0.001h43.081h-0.001l0,0	C74.679,74.94,77.037,62.137,79.395,49.334z M48.648,49.731c0.146,10.606,0.29,21.211,0.439,31.817
    c-2.898,0.078-4.347,0.2-7.235,0.608c-0.789-10.809-1.575-21.616-2.361-32.425L48.648,49.731L48.648,49.731z M62.074,49.731
    c-0.79,10.808-1.576,21.615-2.363,32.425c-2.886-0.409-4.336-0.53-7.234-0.608c0.144-10.605,0.292-21.21,0.438-31.817L62.074,49.731
    L62.074,49.731z M66.408,49.731h9.463c-1.877,11.606-3.757,23.211-5.636,34.818c-2.844-0.896-4.278-1.26-7.155-1.825	C64.191,71.726,65.299,60.729,66.408,49.731z M25.69,49.731h9.464c1.109,10.998,2.216,21.996,3.327,32.993
    c-2.878,0.564-4.311,0.929-7.156,1.825C29.447,72.942,27.569,61.336,25.69,49.731z"/>
      </svg>
      Apple Muffin   
    </h2>
</div>
              
            
!

CSS

              
                body {
  font-family: 'Raleway', sans-serif;
  background: #f4f0ed;
}

.contain-demo {
  text-align: center;
}

h2,
svg{
  vertical-align: middle;
}

/* Assign colors to each header. Only changes the text color, even though the SVG lives in the h2 */
h2:nth-of-type(1) {
  color: #ed765f;
}

h2:nth-of-type(2) {
  color: #f7d36f;
}

h2:nth-of-type(3) {
  color: #aedd85;
}

h2:nth-of-type(4) {
  color: #9e6d5d;
}

/* Forces the SVG to take the color of the h2. Seriously though */
.icon {
  fill: currentColor;
}

              
            
!

JS

              
                /*
Check out An Apple A Day project here:
https://jonitrythall.github.io/appleproject/

Saw this and was like omg need: 
https://css-tricks.com/cascading-svg-fill-color/
*/


              
            
!
999px

Console