Home  >  Article  >  Web Front-end  >  Detailed explanation of how to create a Chinese and English bilingual menu with CSS

Detailed explanation of how to create a Chinese and English bilingual menu with CSS

小云云
小云云Original
2017-12-14 13:11:062615browse

This article mainly explains how to create a Chinese and English bilingual menu with CSS. This is a CSS Chinese and English bilingual menu that you must like. It supports mouse special effects. Run it first to see the effect. You will definitely be satisfied. A background image is used, please download it yourself.

The code is as follows:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>实用的中英文CSS菜单</title>
<style>
body{
margin:0;
padding:0;
font-size:12px;
}
*
{
margin:0;
padding:0;
text-align:left;
color:#9196A0;
font-family:Verdana;
}
a{
color:#9196A0;
}
a:link {
text-decoration: none
}
a:visited{
text-decoration: none
}
a:hover{
text-decoration:underline;
color:#81BC06
}
#nav{
height:100%;
overflow: hidden;
list-style:none;
margin:0 auto;
width:798px
}
#nav li{
float:left;
font-weight:bold;
height:60px;
background:url(images/navbg.png) #fff repeat-x left bottom;
padding:0
}
#nav a{
text-align:center;
padding-top:20px;
display: block;
height:40px;
line-height:40px;
}
#nav li a.one{width:80px;}
#nav li a.two{width:80px;}
#nav li a.three{width:80px;}
#nav li a.four{width:80px;}
#nav li a.five{width:100px;}
#nav li a.six{width:106px;}
#nav li a.seven{width:100px;}
#nav li a.eight{width:80px;}
#nav li a.nine{width:92px;}
#nav li a:hover.one{background:url(images/navunbg.gif) no-repeat -8px 0}
#nav li a:hover.two{background:url(images/navunbg.gif) no-repeat -8px -60px}
#nav li a:hover.three{background:url(images/navunbg.gif) no-repeat -8px -120px}
#nav li a:hover.four{background:url(images/navunbg.gif) no-repeat -8px -180px}
#nav li a:hover.five{background:url(images/navunbg.gif) no-repeat 4px -240px}
#nav li a:hover.six{background:url(images/navunbg.gif) no-repeat 8px -300px}
#nav li a:hover.seven{background:url(images/navunbg.gif) no-repeat 4px -360px}
#nav li a:hover.eight{background:url(images/navunbg.gif) no-repeat -8px -420px}
#nav li a:hover.nine{background:url(images/navunbg.gif) no-repeat 0 -480px}
</style>
</head>
<body>
<p> </p>
<ul id="nav">
<li><a href="#" class="one">网站首页</a></li>
<li><a href="#" class="two">关于我们</a></li>
<li><a href="#" class="three">最新更新</a></li>
<li><a href="#" class="four">更新排行</a></li>
<li><a href="#" class="five">建站服务流程</a></li>
<li><a href="#" class="six">客户案例</a></li>
<li><a href="#" class="seven">网站使用指南</a></li>
<li><a href="#" class="eight">网页特效</a></li>
<li><a href="#" class="nine">联系我们</a></li>
</ul>
<!--nav end-->

Related recommendations:

Use pure CSS to implement the filter menu function

Steps to implement animated drop-down menu effect using css3

Detailed explanation of the customization method of PHP WeChat menu

The above is the detailed content of Detailed explanation of how to create a Chinese and English bilingual menu with CSS. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn