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="tab">
	<div class="tab_content">
		<div class="tabs_item">
			<h3>Вкладка #01</h3>
			<p>Але щоб ви зрозуміли, звідки виникає це хибне уявлення людей, цуратись насолоди і вихваляти страждання, я розкрию перед вами всю картину і роз’ясню, що саме говорив цей чоловік, який відкрив істину, якого я б назвав зодчим щасливого життя. Дійсно, ніхто не відкидає, не зневажає, не уникає насолод тільки через те, що це насолоди, але лише через те, що тих, хто не вміє розумно вдаватися насолоді, осягають великі страждання. </p>
		</div>
		<div class="tabs_item">
			<h3>Вкладка #02</h3>
			<p>Так само як немає нікого, хто полюбивши, вважав за краще і зажадав би саме страждання тільки за те, що це страждання, а не тому, що інший раз виникають такі обставини, коли страждання і біль приносять якесь і чималу насолоду. Якщо скористатися найпростішим прикладом, то хто з нас став би займатися якими б то не було тяжкими фізичними вправами, якщо б це не приносило з собою якоїсь користі? </p>
		</div>
		<div class="tabs_item">
			<h3>Вкладка #03</h3>
			<p>І хто міг би по справедливості дорікнути прагнення до насолоди, яке не несло б з собою ніяких неприємностей, або того, хто уникав би такого страждання, яке не приносило б з собою ніякої насолоди? Але ми цураємось і вважаємо, що заслуговують справедливого обурення ті, хто, піддався звабі і розбещеним спокусам, які дають їм насолоду, і без тями від пристрасті не передбачили, яких страждань і які нещастя на них чекають.</p>
		</div>
		<div class="tabs_item">
			<h3>Вкладка #04</h3>
			<p>Вони винні так само, як і ті, хто через душевну слабкість, тобто через бажання уникнути страждань і болю відмовляється від виконання свого обов’язку. Втім, тут дуже легко і просто провести відмінності, тому що, коли ми вільні і нам надана повна можливість вибору бажаного, коли ніщо не заважає нам робити те, що нам більше подобається, будь яку насолоду слід визнати бажаним, а будь-яке страждання огидним. </p>
		</div>
	</div>
	<ul class="tabs">
		<li class="current"><span>&#9818;</span></li>
		<li><span>&#9819;</span></li>
		<li><span>&#9820;</span></li>
		<li><span>&#9822;</span></li>
	</ul>
</div>
<footer>
	<pre>&copy; 2019 Designed and coded with ❤️ by <a rel="author" href="//sparklingman.com">Sparklingman</a></pre>
</footer>
              
            
!

CSS

              
                *,
html,
body {
	margin: 0;
	padding: 0;
}
body {
	background: blue;
	color: white;
	font-size: 100%;
	font-family: monospace, sans-serif;
	line-height: 1;
}
h3 {
	color: gold;
	padding: 10px 0;
}
a {
	color: gold;
}
/***Tab style***/
.tab {
	box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.2);
	margin: 50px auto;
	max-width: 700px;
	width: 100%;
}
.tabs_item {
	display: none;
	line-height: 1.5;
	padding: 25px;
}
.tabs_item:first-child {
	display: block;
}
.tabs {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	list-style: none;
}
.tabs li {
	background: #00ffbf;
	color: black;
	cursor: pointer;
	font-size: 30px;
	padding: 25px 0;
	text-align: center;
	transition: all 0.15s linear;
}
.tabs li:hover {
	box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.15) inset;
}
.tabs li.current {
	background: gold;
}
footer {
	padding: 50px 0;
	text-align: center;
}

              
            
!

JS

              
                $(".tabs li").click(function (g) {
	var tab = $(this).closest(".tab"),
		index = $(this).closest("li").index();
	tab.find(".tabs li").removeClass("current");
	$(this).closest("li").addClass("current");
	tab
		.find(".tab_content")
		.find("div.tabs_item")
		.not("div.tabs_item:eq(" + index + ")")
		.hide();
	tab
		.find(".tab_content")
		.find("div.tabs_item:eq(" + index + ")")
		.fadeIn();
	g.preventDefault();
});

              
            
!
999px

Console