<header>
	<input type="checkbox" id="button">
	<ul>
		<li><a href="#">home</a></li>
		<li><a href="#">about</a></li>
		<li><a href="#">services</a></li>
		<li><a href="#">portfolio</a></li>
		<li><a href="#">contact</a></li>
	</ul>
</header>
/* reset start */
* {
	margin: 0;
	padding: 0;
	outline: 0;
	box-sizing: border-box;
}

a {
	text-decoration: none;
}

li {
	list-style-type: none;
}
/* reset end */

/* our code start */
header {
	position: relative;
	padding: 10px;
	background: #333333;
	text-align: center;
}

ul a {
	color: #fff;
	display: block;
	padding: 10px 30px;
	font-size: 20px;
	text-transform: capitalize;
	transition: all .5s ease;
}

ul a:hover {
	background: #fff;
	color: #333;
}

ul {
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%) scaleY(.5);
	transform-origin: top center;
	text-align: left;
	white-space: no-wrap;
	background: #000;
	padding: 10px 0 15px;
	border: 1px solid #333;
	visibility: hidden;
	opacity: 0;
	
	transition: all .3s ease;
}

/* এখানেই আমাদের মূল ঘটনা ঘটতেছে */
input:checked ~ ul {
	visibility: visible;
	opacity: 1;
	transform: translateX(-50%) scaleY(1);
}
/* মূল ঘটনার শুভ সমপ্তি */
/* our code end */
Rerun