<!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 runat="server">
<title>scrollTest</title>
<style type="text/css">
.div {
border-right: #00ffff 1px solid;
border-top: #00ffff 1px solid;
border-left: #00ffff 1px solid;
border-bottom: #00ffff 1px solid;
}
<!--
ul {
margin: 0;
padding: 0;
list-style: none;
border-right: 1px solid #ccc;
font: normal 12px verdana;
}
ul li ul {
margin: 0;
padding: 0;
list-style: none;
border-bottom: 1px solid #ccc;
}
ul li {
position: relative;
float:left;
width: 80px;
text-align:center;
}
ul li ul li {
position: relative;
float:inherit;
}
li ul {
position: absolute ;
left: 0px;
top: 24px;
display: none; }
/* Styles for Menu Items */
li a:hover{
background: #146C9C;
color: #fff;
}ul li a {
display: block;
text-decoration: none;
color: #777;
background: #fff; /* IE6 Bug */
padding: 5px;
border: 1px solid #ccc; /* IE6 Bug */
border-right:0;
height:12px;
}
ul li ul li a {
display: block;
text-decoration: none;
color: #777;
background: #fff; /* IE6 Bug */
padding: 5px;
border: 1px solid #ccc; /* IE6 Bug */
border-bottom:0;
border-right:0;
}
/* Holly Hack. IE Requirement \*/
* html ul li { float: left; height: 1%; }
* html ul li a { height: 1%; }
/* End */
li:hover ul, li.over ul { display: block; } /* The magic */
-->
</style><script type="text/javascript" language="javascript"> // JavaScript Document
startList = function () {
if (document.all && document.getElementById) {
navRoot = document.getElementById("nav1");
for (i = 0; i < navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName == "LI") {
node.onmouseover = function () {
this.className += " over";
}
node.onmouseout = function () {
this.className = this.className.replace(" over", "");
}
}
}
}
}
window.onload = startList; </script></head>
<body >
<form id="frm1" runat="server"><ul id="nav1"style="margin-top:15px; margin-left:70px">
<li id="01"><a href="#">nothing is impossible</a>
<ul>
<li><a href="#">History</a></li>
<li><a href="#">Team</a></li>
<li><a href="#">Offices</a></li>
</ul>
</li>
<li id="02"><a href="#">test2</a>
<ul>
<li><a href="#">History</a></li>
<li><a href="#">Team</a></li>
<li><a href="#">Offices</a></li>
</ul>
</li>
<li id="03"><a href="#">test3</a>
<ul>
<li><a href="#">apple</a></li>
<li><a href="#">juice</a></li>
<li><a href="#">peach</a></li>
</ul>
</li>
<li id="04" style="border-right: 1px solid #ccc;"><a href="#">test4</a>
<ul>
<li><a href="#">United</a></li>
<li><a href="#">France</a></li>
<li><a href="#">USA</a></li>
<li><a href="#">Australia</a></li>
</ul>
</li>
</ul></form></body>
</html>这个菜单第一个Li因为a标签字数太多被撑开了,跟其他Li高度不一样,但是li的height怎么设都不起作用。
如果设定<a>的height,菜单的文字就不是垂直居中了,该怎么实现菜单的文字不论是一行还是两行,都垂直居中?感谢!
解决方案 »
- Repeater中添加了HeaderTemplate,后台找不到ItemTemplate中的控件
- 紧急求教,这种情况下怎么办呢??????
- 点击按钮后函数中如何区分是由哪个控件引起的页面刷新?
- 请问如何自动生成静态页面?
- E-Mail中的Content-Type,其中multipart/alternative和multipart/related是怎样使用的
- 动态生成的页面在保存数据的时候遇到问题了!
- 哪里错了,好着急啊!
- 关于dataAdapter的问题
- 在线等!!问一个很菜的问题:我现在有一个index.aspx文件还有一个AllUserInfo.cs文件我想在我的index.aspx中用这个文件中的方法返回的值
- 我想写一个全局函数(其他aspx都可调用),应该写在哪儿呀,怎样调用呢???
- VS2008 C# ajax div 调入网页
- 手机版网页图片问题。在线等
至于你说的垂直居中你可以给a加上style="line-height:30px;"
30px就是你设置的a的高度