select下拉折叠动画效果

代码语言:html

所属分类:表单美化

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">

<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Gaegu:400,700&amp;display=swap'>
<style>
* {
	border: 0;
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}
:root {
	--foldDur: 0.7s;
	font-size: calc(24px + (30 - 24)*(100vw - 320px)/(1280 - 320));
}
body, button {
	color: #171717;
	font: 1em Gaegu, cursive;
	line-height: 1.5;
}
body {
	background-image:
		linear-gradient(#8ccfd100 1.35em,#8ccfd1 1.4em 1.45em,#8ccfd100 1.5em),
		linear-gradient(90deg,#e5e5e5 1.35em,#8ccfd1 1.4em 1.45em,#e5e5e5 1.5em);
	background-position: 50% 0;
	background-size: 1.5em 1.5em;
}
form, .select__button, .select__options {
	width: 100%;
}
form {
	margin: auto;
	padding: 3em 1.5em 6em 1.5em;
	max-width: 13.25em;
}
label {
	display: block;
	font-weight: bold;
}
.select, .select__button {
	position: relative;
}
.select {
	margin-bottom: 1.5em;
	perspective: 20em;
}
.select select {
	display: none;
}
.select__button, .select__option {
	background: #f1f1f1;
	cursor: pointer;
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0 0.375em;
}
.select__button {
	animation-duration: var(--foldDur);
	animation-timing-function: ease-in-out;
	animation-direction: reverse;
	border-radius: 0;
	box-shadow:
		-0.05em 0 0 #fff inset,
		0.05em 0 0 #ccc inset,
		0 -0.0.........完整代码请登录后点击上方下载按钮下载查看

网友评论0