css3基于transition属性制作带有图标的水平菜单的悬停动画效果。这是一款简单的图标和文字菜单布局代码。
使用方法:
1、head引入css文件
<!--外调图标库-->
<link rel='stylesheet' href='https://use.fontawesome.com/releases/v5.8.1/css/all.css'>
<!--主要样式-->
<link rel="stylesheet" href="css/style.css">
2、body引入HTML代码
<nav>
<div class="menu">
<ul class="clear">
<li>
<a href="#" title="Home">
<i class="fa fa-home" aria-hidden="true"></i>
<span class="link-text">首页</span>
</a>
</li>
<li>
<a href="#" title="Features">
<i class="far fa-lightbulb" aria-hidden="true"></i>
<span class="link-text">特点</span>
</a>
</li>
<li>
<a href="#" title="Portfolio">
<i class="fas fa-pencil-alt" aria-hidden="true"></i>
<span class="link-text">编辑</span>
</a>
</li>
<li>
<a href="#" title="Blog">
<i class="far fa-comment" aria-hidden="true"></i>
<span class="link-text">博客</span>
</a>
</li>
<li>
<a href="#" title="Contact">
<i class="far fa-envelope" aria-hidden="true"></i>
<span class="link-text">邮箱</span>
</a>
</li>
</ul>
</div>
</nav>