代码如下:<!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></title>
<script type="text/javascript" src="../Js/jquery-1.4.2.js"></script>
<script type="text/javascript">
$(function() {
// if ($.browser.msie && $.browser.version.toString() == '6.0') {
$(".proclass1_d").hover(function() { $(this).addClass("b");
}, function() {
$(this).removeClass("b");
});
// }
});
</script>
<style type="text/css">
html{ margin:0 auto; width:908px; }
.b{ border:solid 1px #7cc0e3; overflow:hidden;}.list{ float:left; width:677px; overflow:hidden; }
.list div{ float:left; overflow:hidden; width:220px; } </style>
</head>
<body>
<div class="list"><div class='proclass1_d ' id='26'>
这是内容
</div>
<div class='proclass1_d ' id='Div6'>
这是内容
</div><div class='proclass1_d ' id='Div7'>
这是内容
</div>
<div class='proclass1_d ' id='Div8'>
这是内容
</div>
<div class='proclass1_d ' id='Div9'>
这是内容
</div>
<div class='proclass1_d ' id='Div10'>
这是内容
</div></div></body>
</html>
鼠标移动到第1个,第2个的时候,DIV的高度发生了变化,怎么让其高度不变,只需边框效果
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title></title>
<script type="text/javascript" src="../Js/jquery-1.4.2.js"></script>
<script type="text/javascript">
$(function() {
// if ($.browser.msie && $.browser.version.toString() == '6.0') {
$(".proclass1_d").hover(function() { $(this).addClass("b");
}, function() {
$(this).removeClass("b");
});
// }
});
</script>
<style type="text/css">
html{ margin:0 auto; width:908px; }
.b{ border:solid 1px #7cc0e3; overflow:hidden;}.list{ float:left; width:677px; overflow:hidden; }
.list div{ float:left; overflow:hidden; width:220px; } </style>
</head>
<body>
<div class="list"><div class='proclass1_d ' id='26'>
这是内容
</div>
<div class='proclass1_d ' id='Div6'>
这是内容
</div><div class='proclass1_d ' id='Div7'>
这是内容
</div>
<div class='proclass1_d ' id='Div8'>
这是内容
</div>
<div class='proclass1_d ' id='Div9'>
这是内容
</div>
<div class='proclass1_d ' id='Div10'>
这是内容
</div></div></body>
</html>
鼠标移动到第1个,第2个的时候,DIV的高度发生了变化,怎么让其高度不变,只需边框效果
.proclass1_d{border:solid 1px #fff;}
.proclass1_d{border:solid 1px #fff;}你要做的只是默认情况也有边框,只不过边框的颜色是背景色一致,hover的时候只用变化颜色即可