<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<style type="text/css">
span#select {
border:1px solid #ff0000;
width:123px;
height:19px;
clip:rect(0px,18px,22px,0px);
overflow:hidden;
}
span#select select {
position:relative;
left:-1px;
top:-1px;
font-size:12px;
width:125px;
line-height:18px;
border:0px;
}
</style>
</head>
<body>
<span id="select">
<select>
<option>google.com</option>
<option>baidu.com</option>
<option>sohu.com</option>
<option>yahoo.com</option>
<option>sogou.com</option>
</select>
</span>
<select>
<option>google.com</option>
<option>baidu.com</option>
<option>sohu.com</option>
<option>yahoo.com</option>
<option>sogou.com</option>
</select>
</body>
</html>
本文介绍了一种使用HTML和CSS实现固定宽度和高度的下拉菜单方法,并展示了如何通过CSS样式控制下拉选项的显示。
7839

被折叠的 条评论
为什么被折叠?



