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="yesno clearfix">
<div id="q_01" class="positionFit">
<h2>Question1</h2>
<p>お探しの商品はどのタイプですか?</p>
<ul class="col_2">
<li><a class="yn_btn" href="#q_02_A">タイプA</a></li>
<li><a class="yn_btn" href="#q_02_B">タイプB</a></li>
</ul>
</div>
<div id="q_02_A" style="display: none;">
<h2>Question2</h2>
<p>Aタイプの中でお探しの商品は何色ですか?</p>
<ul class="col_3">
<li><a class="yn_btn" href="#q_03_A">A色</a></li>
<li><a class="yn_btn" href="#q_03_B">B色</a></li>
<li><a class="yn_btn" href="#q_03_C">C色</a></li>
</ul>
</div>
<div id="q_02_B" style="display: none;">
<h2>Question2</h2>
<p>Bタイプの中でお探しの商品は何色ですか?</p>
<ul class="col_3">
<li><a class="yn_btn" href="#q_03_D">D色</a></li>
<li><a class="yn_btn" href="#q_03_E">E色</a></li>
<li><a class="yn_btn" href="#q_03_F">F色</a></li>
</ul>
</div>
<div id="q_03_A" style="display: none;">
<h2>Answer A</h2>
<p>ご希望の商品はこちらですか?</p>
<ul class="col_1">
<li>AタイプのA色</li>
</ul>
</div>
<div id="q_03_B" style="display: none;">
<h2>Answer B</h2>
<p>ご希望の商品はこちらですか?</p>
<ul class="col_1">
<li>AタイプのB色</li>
</ul>
</div>
<div id="q_03_C" style="display: none;">
<h2>Answer C</h2>
<p>ご希望の商品はこちらですか?</p>
<ul class="col_1">
<li>AタイプのC色</li>
</ul>
</div>
<div id="q_03_D" style="display: none;">
<h2>Answer D</h2>
<p>ご希望の商品はこちらですか?</p>
<ul class="col_1">
<li>BタイプのD色</li>
</ul>
</div>
<div id="q_03_E" style="display: none;">
<h2>Answer E</h2>
<p>ご希望の商品はこちらですか?</p>
<ul class="col_1">
<li>BタイプのE色</li>
</ul>
</div>
<div id="q_03_F" style="display: none;">
<h2>Answer F</h2>
<p>ご希望の商品はこちらですか?</p>
<ul class="col_1">
<li>BタイプのF色</li>
</ul>
</div>
</div>
              
            
!

CSS

              
                .yesno {
        height: 500px;
	position:relative;
  padding:0;
  margin:0;
}
.yesno ul li {
    list-style: none;
    float: left;
    text-align: center;
    display: block;
    font-size: 120%;
    color: #333A40;
}
.positionFit {
	position:absolute;
	left: 0px;
	top: 20px;
}
.col_1 li {
	width: 99%;
	margin: 1%;
}
.col_2 li {
	width: 48%;
	margin: 1%;
}
.col_3 li {
	width: 31%;
	margin: 1%;
}
.yesno ul li a {
	color: #FFF;
	text-decoration: none;
	width: 100%;
	display: block;
	background-color: #333A40;
	padding: 15px 0;
}
.yesno div {
	clear: both;
	width: 100%;
}
.yesno ul li a:hover {
	background-color: #000;
}
              
            
!

JS

              
                 $(function(){
	        $(".yn_btn").on("click", function() {
			   $(this).closest("div").css("display","none");
			   id = $(this).attr("href");						   
			   $(id).addClass("positionFit").show("fast");
			});
});		
              
            
!
999px

Console