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

              
                <div class="container">

  <div class="light_box"></div>
  
  <section class="tv">
    <h1>TV</h1>

    <div class="tv_onoff col_1">
      <div><button type="button" name="tv" value="power">ON/OFF</button></div>
    </div>

    <div class="tv_volume col_2">
      <div><button type="button" name="tv" value="vol-up">+</button></div>
      <div><button type="button" name="tv" value="vol-down">-</button></div>
    </div>

    <div class="tv_other col_auto">
      <div><button type="button" name="tv" value="timer">SLEEP</button></div>
    </div>

    <div class="tv_channel col_3">
      <div><button type="button" name="tv" value="ch-1">1</button></div>
      <div><button type="button" name="tv" value="ch-2">2</button></div>
      <div><button type="button" name="tv" value="ch-3">3</button></div>
      <div><button type="button" name="tv" value="ch-4">4</button></div>
      <div><button type="button" name="tv" value="ch-5">5</button></div>
      <div><button type="button" name="tv" value="ch-6">6</button></div>
      <div><button type="button" name="tv" value="ch-10">10</button></div>
    </div>
  </section>

  <section class="light">
    <h1>Light</h1>

    <div class="col_2">
      <div><button type="button" name="ir" value="ライトオン">ON</button></div>
      <div><button type="button" name="ir" value="ライトオフ">OFF</button></div>
    </div>
  </section> 

  <section class="aircon">
    <h1>Air-Conditioner</h1>

    <div class="ac_now col_2">
      <div>
        <p>現在の気温</p>
        <p id="now_temp">未取得</p>
      </div>
      <div id="now_ope">
        <p id="now_onoff">運転状況</p>
      </div>
    </div>

    <div class="ac_onoff col_2">
      <div><button class="ac" type="button" name="ac_onoff" value="">ON</button></div>
      <div><button class="ac" type="button" name="ac_onoff" value="power-off">OFF</button></div>
    </div>
  
    <div class="col_3">
      <div class="select_box">
        <select id="mode_select" class="ac" size="1">
          <option value="warm">暖房</option>
          <option value="cool">冷房</option>
          <option value="dry">DRY</option>
        </select>
      </div>

      <div class="select_box">
        <select id="temp_select" class="ac" size="1">
          <option value="30">30°</option>
          <option value="29">29°</option>
          <option value="28">28°</option>
          <option value="27">27°</option>
          <option value="26">26°</option>
          <option value="25">25°</option>
          <option value="24">24°</option>
          <option value="23">23°</option>
          <option value="22">22°</option>
          <option value="21">21°</option>
          <option value="20">20°</option>
        </select>
      </div>

      <div class="select_box">
        <select id="vol_select" class="ac" size="1">
          <option value="auto">AUTO</option>
          <option value="3">強</option>
          <option value="2">中</option>
          <option value="1">弱</option>
        </select> 
      </div>
    </div>
  </section>

  <section class="fan">
    <h1>Fan</h1>

    <div class="fan_onoff col_2">
      <div><button type="button" name="ir" value="扇風機オン">ON</button></div>
      <div><button type="button" name="ir" value="扇風機オフ">OFF</button></div>
    </div>
    <div class="fan_other col_auto">
      <div><button type="button" name="ir" value="扇風機">SLEEP</button></div>
      <div><button type="button" name="ir" value="首振り">SWING</button></div>
    </div>
  </section>
</div>
              
            
!

CSS

              
                body{
  background-color:#fff;
  font-size:1.0rem;
  line-height: 1.0rem;
}
.container{
  width: 90%;
  margin: 2rem auto;
}
section{
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border: solid 1px #ddd;
  border-radius: 0.5rem;
}

.col_1, .col_2, .col_3, .col_auto{
  width: 80%;
  margin: 0 auto 1.5rem;
  grid-gap: 1.0rem;
}
.col_2{
  display: grid;
  grid-template-columns: repeat(2,1fr);
}
.col_3{
  display: grid;
  grid-template-columns: repeat(3,1fr);
}
.col_auto{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}

h1{
  padding:1.3rem 0;
  text-align:center;
  color:#111;
  font-weight:normal;
  font-size:1.2rem;
}

button{
  display:block;
  width: 100%;
  padding: 1.0rem;
  background-color: #f0f0f0;
  border: none;
  color:#111;
  font-size:1.1rem;
  text-align: center;
  text-decoration: none;
}
button:hover{
  background-color:#ddd;
}

select{
  width: 100%;
  height: 3.0rem;
  background-color: #f0f0f0;
  border: none;
  font-size:1.0rem;
}

.tv_channel div, .tv_channel button, .ac_now #now_ope{
  display: flex;
  justify-content: center;
  align-items: center;
}
.tv_channel button{
  width: 4.0rem;
  height: 4.0rem;
  padding: 0;
  border-radius: 50%;
}

.ac_now div{
  padding: 0.6rem 0;
  text-align: center;
}
#now_temp{
  padding-top: 0.8rem;
  font-size: 1.2rem;
}
#now_ope{
  border: solid 1px #ddd;
  border-radius: 0.4rem;
  transition: all  0.3s ease;
}
#now_ope.now_cool{
  background-color: #09f;
  color: #fff;
}
#now_ope.now_warm{
  background-color: #f91;
  color: #fff;
}
#now_ope.now_dry{
  background-color: #0ff;
}

.light_box{
  position: fixed;
  width: 1rem;
  height: 3rem;
  margin-left: -1.0rem;
  border: solid 1px #ddd;
  border-radius: 3.0rem;
}
.flash{
  animation: flash 0.5s linear 2;
}
@keyframes flash {
  0%{
    opacity: 0;
  }
  50% {
    opacity: 1;
    background-color:#6cf;
  }
}

@media screen and (min-width: 768px) {
  .container{
    width: 45%;
  }
  .light_box{
    margin-left: -2.0rem;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console