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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

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

Console