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 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

              
                <body>
   <h2>CSS3 Target Tab</h2>
      <div class="target_demo">
        <div id="tab1" class="tab_content">
          <p>斯德哥尔摩综合征(英语:Stockholm syndrome;瑞典语:Stockholmssyndromet)又称为人质情结、人质综合症,是指犯罪的被害者对于加害者产生情感,甚至反过来帮助加害者的一种情结。</p>
        </div>
        
        <div id="tab2" class="tab_content">
        <p>木桶原理又称短板理论,木桶短板管理理论,所谓“木桶理论”也即“木桶定律”,其核心内容为:一只木桶盛水的多少,并不取决于桶壁上最高的那块木块,而恰恰取决于桶壁上最短的那块。根据这一内容,可以有两个推论:其一,只有桶壁上的所有木板都足够高,那木桶才能盛满水。其二,只要这个木桶里有一块不够高度,木桶里的水就不可能是满的。</p>
        </div>
        
        <div id="tab3" class="tab_content">
          <p>我们知道的木桶定律——桶装水的多少,取决于最短的一块板子。传统的木桶定律是把木桶放在平面上来衡量的。但是,如果把木桶放置在一个斜面上的时候,木桶装水的多少就取决于最长的一块板子的长度。当然这要求长与长要正相对,并且长木块的周围要有相。</p>
        </div>
        
           <div id="tab4" class="tab_content">
          <p>不值得定律最直观的表述是:不值得做的事情,就不值得做好,这个定律似乎再简单不过了,但它的重要性却时时被人们疏忽。不值得定律反映出人们的一种心理,一个人如果从事的是一份自认为不值得做的事情,往往会保持冷嘲热讽,敷衍了事的态度。不仅成功率小,而且即使成功,也不会觉得有多大的成就感</p>
        </div>
        
        <ul class="tabs">
          <li><a href="#tab1">Tab1</a></li>
          <li><a href="#tab2">Tab2</a></li>
          <li><a href="#tab3">Tab3</a></li>
          <li><a href="#tab4">Tab4</a></li>
        </ul>
      </div>
              
            
!

CSS

              
                .tabs {
	position: absolute;
	bottom: 100%;
	left: 0;
	/*z-index: 2;*/
}
.tabs:after {
	visibility: hidden;
	display: block;
	font-size: 0;
	content: " ";
	clear: both;
	height: 0;
}
.tabs li {
	display: inline-block;
	margin-left: -1px;
}
.tabs li a {
	color:#000;	
	padding: 4px 10px;
	background: #fff;
	border: 1px solid #ccc;
	background: -moz-linear-gradient(top, #fff, #eee);
	background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#eee));
	text-decoration: none;
	display:inline-block;
}
.tabs li a:hover{text-decoration:none;}
.target_demo {
	margin: 0 0 120px 0;
	position: relative;
	margin-top: 150px;
	min-height: 300px;
}
.target_demo .tab_content {
	border: 1px solid #ccc;
	background: #fff;
	padding: 20px;
	min-height: 250px;
	position: absolute;
	top: -1px;
	left: 0;
	width:600px;
}
#tab1:target, #tab2:target, #tab3:target {
	z-index: 1;
}
#tab1:target ~ .tabs li a[href="#tab1"], #tab2:target ~ .tabs a[href="#tab2"], #tab3:target ~ .tabs a[href="#tab3"] {
	border-bottom-color:#fff;
}
              
            
!

JS

              
                
              
            
!
999px

Console