IE6 下:hover 中bug解决了(纯CSS)
这个bug,主要是一个二级菜单,在ie7中hover时正常显示出来,在ie6下没有效果。在网上找了很多资料,弄了好几天,最终是参照别人的代码,用的纯css经过自己的整理,就把它给弄下来了。希望以后自己多来看看。
如下:
-------------------
css代码:
.allMenu
{
width: 894px;
height: 22px;
line-height: 22px;
margin: 7px 3px 1px 3px;
background: url(images/menubg.GIF) repeat-x top left;
}
.allMenu .select
{
padding: 0px;
margin: 0px;
white-space: nowrap;
list-style-type: none;
}
.allMenu LI
{
height: auto;
padding: 0px;
float: left;
margin: 0px;
}
.allMenu .select A
{
height: 22px;
padding: 0 20px 0 20px;
display: block;
float: left;
color: Black;
line-height: 22px;
white-space: nowrap;
text-decoration: none;
}
.allMenu .select A:hover /* for ie6 */
{
cursor: pointer;
background: url(images/hoverbg.JPG) repeat-x top left;
}
.allMenu .select LI:hover A
{
cursor: pointer;
background: url(images/hoverbg.JPG) repeat-x top left;
}
.allMenu .select A:hover B /* for ie6,主要在ie6下样式有变化 */
{
cursor: pointer;
background: url(images/hoverbg.JPG) repeat-x top left;
display: block;
float: left;
}
.allMenu .select_sub {
display: none; /*不可见*/
}
.allMenu .sub
{
padding: 0px;
margin: 0px auto;
list-style-type: none;
}
.nav TABLE
{
font-size: 1em;
&nbs
相关文档:
只针对ie6,ie7和firefox的csshack
注意都要写在正常样式的后边,除!important方法在前边
---------------针对样式名------------
如果只让ie6看见用*html .head{color:#000;}
如果只让ie7看见用*+html .head{color:#000;}
如果只让ff看见用:root body .head{color:#000;}
如果只让ff、IE8看见用html>/**/body .he ......
JavaScript CSS Style属性对照表
文章来源:http://www.phplamp.org/2008/10/jsavscript-js-css-style/
为了达到某种特殊的效果我们需要用Javascript动态的去更改某一个标签的Css属性。比如:鼠标经过一个图片时我们让图片加一个边框,代码可能是这样:
JavaScript代码
<script type="text/javascript"> & ......
<style>
#enlarge {padding:0; margin:2em auto; list-style-type:none; width:240px;
height:40px;}
#enlarge li {display:block; float:left; width:40px; height:40px;
position:relative;}
#enlarge li a {display:block; width:40px; height:40px; background:transparent;
overflow:hidden; positio ......
转:写的不错,对于网页开发有指导意义
在《欲练 CSS ,必先宫 IE》和《你有 <table /> 强迫症吗?》这两篇文章中,看到有不少评论用到div+CSS布局这个说法,用来和table布局比较。实际上div不是用来布局的,div只是用来表示一个其它元素都无法准确表达语意的一个块区,只有CSS是用于布局的,所以根本就不存在di ......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<TITLE>无刷新变换样式表</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" /& ......