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

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="hidden_box">
    <input type="checkbox" id="label1"/>
    <label for="label1"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12" cy="12" r="12" fill="#D7DAE0"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.64645 8.64645C8.84171 8.45118 9.15829 8.45118 9.35355 8.64645L15.7286 15.0214C15.9238 15.2167 15.9238 15.5333 15.7286 15.7286C15.5333 15.9238 15.2167 15.9238 15.0214 15.7286L8.64645 9.35355C8.45118 9.15829 8.45118 8.84171 8.64645 8.64645Z" fill="#292C33"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.64645 15.7286C8.45118 15.5333 8.45118 15.2167 8.64645 15.0214L15.0214 8.64645C15.2167 8.45118 15.5333 8.45118 15.7286 8.64645C15.9238 8.84171 15.9238 9.15829 15.7286 9.35355L9.35355 15.7286C9.15829 15.9238 8.84171 15.9238 8.64645 15.7286Z" fill="#292C33"/>
</svg>
</label>
    <!-- ここの遷移リンクを変える -->
    <a href="https://www.google.com/" target="_blank" class="hidden_show">
      <!-- ここの画像リンクを変える -->
      <img class="banner-img" width="260" height="100" 
           src="https://images.unsplash.com/photo-1493397212122-2b85dda8106b?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=Mnw2MzQ2fDB8MXxzZWFyY2h8Mnx8QXJjaGl0ZWN0dXJlfGVufDB8fHx8MTYyNjc1MDc5Nw&ixlib=rb-1.2.1&q=80&w=1080">
      </a>
</div>
              
            
!

CSS

              
                .hidden_box {
  position: relative;
  width: min-content;
  margin: 0;
  padding-top: 14px;
  padding-right: 12px;
}

/*バツボタン*/
.hidden_box label {
  display: block;
  position: absolute;
  width: 24px;
  height: 24px;
  top: 0px;
  right: 0px;
  margin: auto;
  text-align: center;
  line-height: 30px;
  box-shadow: 0px 8px 24px -8px rgba(0, 13, 147, 0.32);
  cursor :pointer;
  transition: 0.3s;
  z-index:1;
  background: #fff;
  border-radius: 100%;
}

.hidden_box label:hover {
  background: #fff;
}

.hidden_box .banner-img {
  display: block;
}

/*バナー装飾*/
.hidden_box .hidden_show {
  display: block;
  width: min-content;
  height: auto;
  background: #fff;
  cursor:pointer;
  border: 1px solid #EAECF1;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0px 21.248px 42.496px -21.248px rgba(0, 13, 147, 0.16);
  transition: 0.3s;
  /*表示する*/
  opacity: 1;
  pointer-events: auto;
}

.hidden_box .hidden_show img {
  transition: 0.3s;
}

/*バナーホバー時*/
.hidden_box .hidden_show:hover img {
   opacity: 0.85;
}

/*チェックは見えなくする*/
.hidden_box input {
    display: none;
}

/*クリックで非表示*/
.hidden_box input:checked ~ .hidden_show,
.hidden_box input:checked ~ label{
  opacity: 0;
  cursor: auto;
  pointer-events: none;
}
              
            
!

JS

              
                
              
            
!
999px

Console