cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

            
              <html lang="ru">
<head>
	<meta charset="UTF-8">
	<title>Тестовое задание аккордион</title>
	
</head>
<body>
	<div class="wrap">
		<main class="main">
				
			<div class="accordeon">
				<div class="accordeon-item active">
					<div class="accordeon-item-title">
						<div class="accordeon-item-title-ico"></div>
						<div class="accordeon-item-title-text">Основы языка и как на нём говорить правильно</div>
					</div>
					<div class="accordeon-item-content">
						Лексическая структура<br>
						Типы данных, значения и переменные<br>
						Выражения и операторы инструкции
					</div>
				</div><!-- /accordeon-item -->

				<div class="accordeon-item">
					<div class="accordeon-item-title">
						<div class="accordeon-item-title-ico"></div>
						<div class="accordeon-item-title-text">Функции</div>
					</div>
					<div class="accordeon-item-content">
						Лексическая структура<br>
						Типы данных, значения и переменные<br>
						Выражения и операторы инструкции
					</div>
				</div><!-- /accordeon-item -->

				<div class="accordeon-item">
					<div class="accordeon-item-title">
						<div class="accordeon-item-title-ico"></div>
						<div class="accordeon-item-title-text">Обработка ошибок и отладка</div>
					</div>
					<div class="accordeon-item-content">
						Лексическая структура<br>
						Типы данных, значения и переменные<br>
						Выражения и операторы инструкции
					</div>
				</div><!-- /accordeon-item -->

				<div class="accordeon-item">
					<div class="accordeon-item-title">
						<div class="accordeon-item-title-ico"></div>
						<div class="accordeon-item-title-text">Объекты и массивы</div>
					</div>
					<div class="accordeon-item-content">
						Лексическая структура<br>
						Типы данных, значения и переменные<br>
						Выражения и операторы инструкции
					</div>
				</div><!-- /accordeon-item -->

				<div class="accordeon-item">
					<div class="accordeon-item-title">
						<div class="accordeon-item-title-ico"></div>
						<div class="accordeon-item-title-text">События</div>
					</div>
					<div class="accordeon-item-content">
						Лексическая структура<br>
						Типы данных, значения и переменные<br>
						Выражения и операторы инструкции
					</div>
				</div><!-- /accordeon-item -->

				

			</div><!-- /accordeon -->
		</main>
	</div><!-- /wrap -->
</body>
</html>
            
          
!
            
              		.wrap{
			width: 500px;
			margin: 0 auto;
		}
		.main{
			padding: 100px 20px 20px 20px;
			font-family: Fira Sans light, Geneva, Arial, Helvetica, sans-serif;

		}
		.accordeon-item{
			background-color: #e7e7e7;
			color: #4f4f4f;
			margin-bottom: 5px;
			-webkit-border-radius: 20px;
			border-radius:20px;
		}
		
		.accordeon-item-title{
			font-family: Fira Sans, Geneva, Arial, Helvetica, sans-serif;
			background-color: #696666;
			color: #fff;
			font-weight: bold;
			padding: 15px 20px;
			cursor: pointer;
			-webkit-border-radius: 20px;
			border-radius: 20px;

			-webkit-transition: all 0.5s ease;
			-moz-transition: all 0.5s ease;
			-ms-transition: all 0.5s ease;
			-o-transition: all 0.5s ease;
			transition: all 0.5s ease;
		}
		.accordeon-item:nth-child(even) .accordeon-item-title{
			background-color: #f1f1f1; 
			color: #696666;
		}
		.accordeon-item.active .accordeon-item-title{
			background-color: #ff8663;
			color: #ffffff;
		}
		.accordeon-item-content{
			height: 0;
			padding: 0px 24px;
			overflow: hidden;
			/* display: none; */
			-webkit-transition: all 0.5s ease;
			-moz-transition: all 0.5s ease;
			-ms-transition: all 0.5s ease;
			-o-transition: all 0.5s ease;
			transition: all 0.5s ease;	
		}
		.accordeon-item.active .accordeon-item-content{
			/* display: block; */
			padding: 15px 24px;
			height: auto;
			overflow: none;
		}
		.accordeon-item-title-ico{
			margin-top: 5px;
			float: right;
			width: 0;
			height: 0;
			border-left: 7px solid transparent;
			border-right: 7px solid transparent;
			border-top: 14px solid #ff8663;
		}
		.accordeon-item.active .accordeon-item-title-ico{
			border-left: 7px solid transparent;
			border-right: 7px solid transparent;
			border-bottom: 14px solid white;
			border-top: 0px solid #ff8663;
		}
		.title{
			text-align: center;
			padding-bottom: 20px;
		}
            
          
!
            
              		var accItems = document.querySelectorAll('.accordeon-item'),
			handler = function() {
			for (var i = 0, el; el = accItems[i]; i++){
			    el.classList.remove("active");
			}
			this.parentNode.classList.add("active");
		},
		items = document.querySelectorAll('.accordeon-item-title');
		for (var i = 0, item; item = items[i]; i++){
		    item.onclick = handler;
		}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console