CSS 样式偏移,如何解决_html/css_WEB-ITnose

WBOY
풀어 주다: 2016-06-24 12:22:52
원래의
1001명이 탐색했습니다.



{position:relative;display:inline;float:left;margin:0px 4px}
CSS 样式偏移,如何解决

在IE6是这样.
 
高版本都正常.


回复讨论(解决方案)

ie6中的margin要写成
margin:0px 2px


不行啊.亲


正常的效果是这样

在IE6下面先做正常后,然后在不同的地方写兼容

你确定这行代码导致的吗?你应该贴全部代码来让我测试

偏到上边了,是不是float到上边的?

是li的样式么,那ul的呢,是不是定位问题呀

你确定这行代码导致的吗?你应该贴全部代码来让我测试

@charset "utf-8";/*********************************************** 横向主导航条 ***********************************************/.ddsmoothmenu{}.ddsmoothmenu ul{margin:0;padding:0}/*主菜单设置*/.ddsmoothmenu ul li{position:relative;display:inline;float:left;margin:0px 4px}.ddsmoothmenu ul li a{display:block;height:30px;line-height:30px}.ddsmoothmenu ul li a span{display:block;padding:0px 15px}/*主菜单连接效果设置*/.ddsmoothmenu ul li a:link,.ddsmoothmenu ul li a:visited{color:#000}.ddsmoothmenu ul li a:hover{background:url(../images/mainmenu.gif) no-repeat center -30px}.ddsmoothmenu ul li a:hover span{color:#FFF}.ddsmoothmenu ul li a:active{background:url(../images/mainmenu.gif) no-repeat center top}.ddsmoothmenu ul li a:active span{color:#FFF}.ddsmoothmenu ul li a.selected{background:url(../images/mainmenu.gif) no-repeat center -30px}.ddsmoothmenu ul li a.selected span{color:#FFF}/*主菜单当前所在页面*/.ddsmoothmenu ul li a#menu_selected{background:url(../images/mainmenu.gif) no-repeat center top}.ddsmoothmenu ul li a#menu_selected span{color:#FFF}/*子集菜单设置*/.ddsmoothmenu ul.menulevel{position:absolute;left:0;display:none;visibility:hidden}.ddsmoothmenu ul.menulevel li{background:none;margin:0px;padding:0px;display:list-item;float:none}.ddsmoothmenu ul.menulevel li a{background:url(../images/mainmenu.gif) repeat-x left -60px;height:26px;line-height:26px;width:180px;padding:0px 5px;margin:0px;border-right:1px solid #999;border-bottom:1px solid #DFDFDF;border-left:1px solid #CCC}/*子集菜单连接效果设置*/.ddsmoothmenu ul.menulevel li ul{top:0}.ddsmoothmenu ul.menulevel li a:link,.ddsmoothmenu ul.menulevel li a:visited{color:#000}.ddsmoothmenu ul.menulevel li a:hover{background:url(../images/mainmenu.gif) repeat-x left -90px;color:#034fab;font-weight:bold}.ddsmoothmenu ul.menulevel li a.selected{background:url(../images/mainmenu.gif) repeat-x left -90px;color:#034fab;font-weight:bold}/*下拉箭头*/.ddsmoothmenu .downarrowclass{position:absolute;top:12px;right:8px}.ddsmoothmenu .rightarrowclass{position:absolute;top:8px;right:10px}/*阴影*/.ddshadow{position:absolute;left:0;top:0;width:0;height:0;background:url(../images/40.png);z-index:1}.toplevelshadow{/*opacity:0.8*/}* html .ddsmoothmenu{height:1%}/* Holly Hack for IE \*//*Holly Hack for IE7 and below*/* html .ddsmoothmenu ul li a{display:inline-block}/*IE6 hack to get sub menu links to behave correctly*//*********************************************** 纵向主导航条 ***********************************************/.ddsmoothmenu-v{padding:0px 10px 0px 15px}.ddsmoothmenu-v ul{}/*主菜单设置*/.ddsmoothmenu-v ul li{position:relative}.ddsmoothmenu-v ul li a{display:block;height:31px;line-height:31px;vertical-align:middle}.ddsmoothmenu-v ul li a span{display:block;padding:0px 20px}/*主菜单连接效果设置*/.ddsmoothmenu-v ul li a:link,.ddsmoothmenu-v ul li a:visited{background:url(../images/leftmenu.gif) no-repeat center -31px;color:#000}.ddsmoothmenu-v ul li a:hover{background:url(../images/leftmenu.gif) no-repeat center top}.ddsmoothmenu-v ul li a:hover span{color:#FFF}.ddsmoothmenu-v ul li a:active{background:url(../images/leftmenu.gif) no-repeat center top}.ddsmoothmenu-v ul li a:active span{color:#FFF}.ddsmoothmenu-v ul li .selected:link,.ddsmoothmenu-v ul li a.selected:visited,.ddsmoothmenu-v ul li a.selected:active{background:url(../images/leftmenu.gif) no-repeat center top}.ddsmoothmenu-v ul li a.selected span{color:#FFF}/*主菜单当前所在页面*/.ddsmoothmenu-v ul li a#menu_selected{background:url(../images/leftmenu.gif) no-repeat center top}.ddsmoothmenu-v ul li a#menu_selected span{color:#FFF}/*子集菜单设置*/.ddsmoothmenu-v ul.menulevel{position:absolute;top:0;visibility:hidden;border-top:1px solid #CCC}.ddsmoothmenu-v ul.menulevel li{background:none;margin:0px;padding:0px;display:list-item}.ddsmoothmenu-v ul.menulevel li a{background:url(../images/mainmenu.gif) repeat-x left -60px;height:26px;line-height:26px;width:180px;padding:0px 5px;margin:0px;border-right:1px solid #999;border-bottom:1px solid #DFDFDF;border-left:1px solid #CCC}/*子集菜单连接效果设置*/.ddsmoothmenu-v ul.menulevel li a:link,.ddsmoothmenu-v ul.menulevel li a:visited{color:#000}.ddsmoothmenu-v ul.menulevel li a:hover{background:url(../images/mainmenu.gif) repeat-x left -90px;color:#034fab;font-weight:bold}.ddsmoothmenu-v ul.menulevel li a.selected{background:url(../images/mainmenu.gif) repeat-x left -90px;color:#034fab;font-weight:bold}/*子集菜单连接效果设置*/.ddsmoothmenu-v ul.menulevel li a:link,.ddsmoothmenu-v ul.menulevel li a:visited{color:#000}.ddsmoothmenu-v ul.menulevel li a:hover{background:url(../images/mainmenu.gif) repeat-x left -90px;color:#034fab;font-weight:bold}.ddsmoothmenu-v ul.menulevel li a.selected{background:url(../images/mainmenu.gif) repeat-x left -90px;color:#034fab;font-weight:bold}/*左侧箭头*/.ddsmoothmenu-v .rightarrowclass{position:absolute;top:10px;right:10px}.ddsmoothmenu-v ul.menulevel .rightarrowclass{position:absolute;top:8px;right:10px}/* Holly Hack for IE \*/* html .ddsmoothmenu-v ul li {float:left;height:1%}* html .ddsmoothmenu-v ul li a {height:1%}
로그인 후 복사

把项目打包发上来吧。。没得调试,难以看出是啥问题。。。

관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!