Jump to content

Проверьте на корректность кода


aqua.77
 Share

Recommended Posts

В принципе всё работает как я хотел и это главное, но возможно эту же задачу можно выполнить более разумно или корректнее? Может ли данный код считаться пригодным? Задача была сделать резиновые кнопки с анимацией.

<ul>
<li><a href="#">Кнопка<span></span></a></li>
<li><a href="#">Кнопка<span></span></a></li>
<li><a href="#">Кнопка<span></span></a></li>
</ul>
@keyframes men{
	from{
		  background: linear-gradient(120deg, #CFA883 10%, white 20%, white 20%, #CFA883 30%);
		  opacity:0;
		}
	to {
		background-position:300px;
		opacity:1;
		}
}
ul{
	border:1px black solid;
}
li{
	display:inline;
}
li a{
	display:inline-block;
	text-decoration:none;
	background:red;
	padding:13px 10px;
	text-align:center;
	width:10%;
	position:relative;
	z-index:100;
	overflow:hidden;
	vertical-align:top;
	transition: all .5s;
}
span{
	position:absolute;
	top:0;
	left:0;
	height:100%;
	width:300px;
	z-index:-1;
}
a:hover span{
	animation: men .5s;
}
a:hover{
	background:#CFA883;
	color:white;
}

 

Edited by aqua.77
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy