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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <div class="container">
  <div class="radio-tile-group">

    <div class="input-container">
      <input id="walk" class="radio-button" type="radio" name="radio" />
      <div class="radio-tile">
        <div class="icon walk-icon">
          <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" width="512px" height="512px" viewBox="0 0 540.201 540.201" style="enable-background:new 0 0 540.201 540.201;" xml:space="preserve">
<g>
	<g>
		<path d="M169.467,194.102v310.136c0,8.086,2.95,15.08,8.862,20.986c5.808,5.809,12.681,8.732,20.6,8.824    c7.914-0.092,14.792-3.016,20.606-8.824c5.906-5.906,8.855-12.9,8.855-20.986V194.102c8.862-3.103,42.081-32.711,42.081-42.204    V27.161c0-4.033-1.481-7.534-4.431-10.49c-2.956-2.95-6.457-4.431-10.49-4.431c-4.045,0-7.54,1.481-10.49,4.431    c-2.956,2.962-4.431,6.457-4.431,10.49v96.99c0,4.045-1.481,7.54-4.431,10.49c-2.956,2.956-6.451,4.425-10.49,4.425    c-4.045,0-7.54-1.469-10.49-4.425c-2.95-2.95-4.431-6.451-4.431-10.49v-96.99c0-4.033-1.481-7.534-4.431-10.49    c-2.95-2.95-6.45-4.431-10.489-4.431c-4.045,0-7.54,1.481-10.49,4.431c-2.956,2.962-4.431,6.457-4.431,10.49v96.99    c0,4.045-1.481,7.54-4.431,10.49c-2.956,2.956-6.451,4.425-10.49,4.425c-4.045,0-7.54-1.469-10.49-4.425    c-2.956-2.95-4.431-6.451-4.431-10.49v-96.99c0-4.033-1.475-7.534-4.431-10.49c-2.95-2.95-6.45-4.431-10.49-4.431    c-4.045,0-7.54,1.481-10.489,4.431c-2.95,2.962-4.431,6.457-4.431,10.49v124.732C121.266,161.384,160.605,190.993,169.467,194.102    z" fill="#0079ad"/>
		<path d="M199.308,534.08c-0.129,0-0.251-0.037-0.38-0.037c-0.128,0-0.245,0.037-0.379,0.037H199.308z" fill="#0079ad"/>
		<path d="M389.848,540.201c-0.129,0-0.25-0.037-0.379-0.037s-0.252,0.037-0.379,0.037H389.848z" fill="#0079ad"/>
		<path d="M326.139,268.588h33.869v241.771c0,8.084,2.949,15.08,8.855,20.984c5.812,5.809,12.686,8.734,20.605,8.826    c7.912-0.092,14.791-3.018,20.605-8.826c5.906-5.904,8.861-12.9,8.861-20.984V14.921c0-4.033-1.48-7.534-4.43-10.49    C411.549,1.481,408.055,0,404.016,0h-10.723c-20.52,0-38.084,7.308-52.693,21.916c-14.607,14.614-21.914,32.179-21.914,52.693    v186.52c0,2.02,0.74,3.77,2.215,5.245C322.369,267.848,324.119,268.588,326.139,268.588z" fill="#0079ad"/>
	</g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>
        </div>
        <label for="walk" class="radio-tile-label">Food</label>
      </div>
    </div>

    <div class="input-container">
      <input id="bike" class="radio-button" type="radio" name="radio" />
      <div class="radio-tile">
        <div class="icon bike-icon">
          <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" width="512px" height="512px" viewBox="0 0 419.139 419.139" style="enable-background:new 0 0 419.139 419.139;" xml:space="preserve">
<g>
	<g>
		<path d="M61.711,229.869c-5.203,26.121,11.441,51.73,37.534,57.361c26.365,5.723,52.451-11.074,58.147-37.439l8.025-73.598    c-26.365-14.307-16.704,44.993-62.243,35.165C71.896,204.588,63.37,224.602,61.711,229.869z" fill="#0079ad"/>
		<path d="M400.293,318.242c-2.062-6.182-8.767-9.598-14.937-7.492l-32.844,10.92l-20.655-62.125    c16.965-8.326,30.872-21.584,39.487-38.789c10.414-20.783,12.104-44.377,4.399-67.404L321.782,28.627L178.297,76.369l9.583,39.001    L65.249,88.859l-40.438,130.82c-4.909,22.729-0.681,46.003,11.919,65.537c10.414,16.165,25.674,27.84,43.438,34.271    l-13.842,63.992l-33.78-7.289c-6.354-1.279-12.661,2.674-14.04,9.061c-1.38,6.381,2.67,12.658,9.057,14.041l45.221,9.77    c0.033,0,0.05,0.029,0.073,0.029c0.051,0.016,0.111,0,0.163,0.016l45.235,9.77c0.846,0.184,1.676,0.264,2.509,0.264    c5.442,0,10.336-3.783,11.533-9.322c1.37-6.385-2.675-12.66-9.062-14.045l-33.804-7.309l13.792-63.729    c2.264,0.184,4.524,0.371,6.789,0.371c40.604,0,76.323-28.859,85.071-69.562l9.588-71.867l6.295,25.597    c11.844,35.626,45.011,59.562,82.521,59.562c5.387,0,10.719-0.648,15.999-1.646l20.6,61.945l-32.78,10.895    c-6.201,2.058-9.555,8.75-7.497,14.932c1.651,4.955,6.264,8.094,11.215,8.094c1.232,0,2.496-0.186,3.729-0.604l88.043-29.271    C399.001,331.117,402.355,324.424,400.293,318.242z M171.83,251.496c-7.193,33.396-41.61,55.811-75.339,48.516l0,0h-0.019    c-16.553-3.568-30.718-13.365-39.887-27.594c-9.166-14.23-12.259-31.182-8.938-46.748l33.776-109.138l105.328,22.772    L171.83,251.496z M233.655,202.727L206.444,91.906l102.265-34.021l44.978,103.889c5.352,16.074,4.102,33.264-3.461,48.4    c-7.587,15.135-20.61,26.42-36.692,31.757c-6.5,2.185-13.255,3.276-20.041,3.276C266.171,245.207,242.025,227.777,233.655,202.727    z" fill="#0079ad"/>
		<path d="M340.563,168.44c-2.276-5.046-12.86-24.037-43.226-13.946c-44.243,14.715-41.044-45.291-65.682-28.225l15.903,72.273    c8.522,25.582,36.274,39.493,61.837,30.974C334.747,221.078,348.532,193.822,340.563,168.44z" fill="#0079ad"/>
		<path d="M136.987,26.714c7.356-0.399,13.016-6.698,12.62-14.065C149.21,5.27,142.9-0.38,135.545,0.02    c-7.387,0.399-13.046,6.698-12.645,14.074C123.303,21.463,129.611,27.113,136.987,26.714z" fill="#0079ad"/>
		<path d="M188.646,50.057c7.352-0.399,13.016-6.698,12.616-14.073c-0.401-7.369-6.71-13.022-14.062-12.623    c-7.383,0.401-13.043,6.698-12.646,14.066C174.953,44.802,181.26,50.457,188.646,50.057z" fill="#0079ad"/>
		<path d="M129.545,61.278c0.398,7.377,6.706,13.03,14.061,12.628c7.387-0.398,13.047-6.697,12.649-14.072    c-0.402-7.368-6.711-13.021-14.096-12.622C134.806,47.611,129.149,53.91,129.545,61.278z" fill="#0079ad"/>
	</g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>
        </div>
        <label for="bike" class="radio-tile-label">Drink</label>
      </div>
    </div>
  </div>
</div>
              
            
!

CSS

              
                * {
  box-sizing: border-box;
  font-family: 'Helvetica Neue', sans-serif;
}

body {
  background-color: black;
}

$primary-color: #079ad9;

.radio-tile-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: left;

  //set dimensions for invisible container
  .input-container {
    position: relative;
    height:  7rem;
    width:  7rem;
    margin: 0.5rem;

    //make actual radio input invisible
    // + stretch to fill container
    .radio-button {
      opacity: 0;
      position: absolute;
      top: 0;
      left: 0;
      height: 100%;
      width: 100%;
      margin: 0;
      cursor: pointer;
    }

    //default tile styles
    .radio-tile {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      width: 100%;
      height: 100%;
      border: 2px solid $primary-color;
      border-radius: 5px;
      padding: 1rem;
      transition: transform 300ms ease;
    }
    .icon svg {
      fill: $primary-color;
      width: 3rem;
      height: 3rem;
    }
    .radio-tile-label {
      text-align: center;
      font-size: 0.75rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 1px;
      color: $primary-color;
    }

    //active tile styles
    .radio-button:checked + .radio-tile {
      background-color: $primary-color;
      border: 2px solid $primary-color;
      color: white;
      transform: scale(1.1, 1.1);
      
      .icon svg {
        fill: white;
        background-color: $primary-color;
      }
      .radio-tile-label {
        color: white;
        background-color: $primary-color;
      }
    }
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console