星空电竞官网

动易模板中心 | 动易技术中心 | 无障碍阅读| 顾客买之前:4008-300-618
目录
目录X

“clear”属性的作用

 解决了CSS中padding这个定义在页面兼容布局的问题后,又发现了的问题:

IE浏览器和GoSuRF Browser浏览器中浏览的效果:


Opera浏览器中浏览的效果(标题顶部缺少间距):


Mozilla Firefox中浏览的效果(标题、副标题都挤得乱套了):

  在Opera挑选访问器中挑选访问的功能中,主题词格式顶上中缺行间距倒也说得去,不少于没导致网站功能;Mozilla Firefox中挑选访问的功能单位中主题词格式、副主题词格式都挤得乱套了,就说明还是名词解释狗熊(Firefox)要认真名词解释,耐烦查下吧。

  首先看下这里的定义:

#ArticleList h3,
#ArticleList h3 a { /***文章标题定义***/
text-align: left;
font-size: 16px; color: #0055FF;
font-weight: bold;
margin-top: 30px; margin-bottom: 0px;
}
#ArticleList h3 a:hover { /***鼠标在链接上文章标题样式定义***/
font-size: 16px; color: #bb0000; background: #f2f2f2;
}
#ArticleSubheading { /***文章副标题定义***/
font-size: 14px; color: #aaa;
text-align: left; margin-bottom: 10px;
}
#ArticleSubheading2 { /***文章副标题定义***/
font-size: 14px; color: #aaa;
text-align: center; margin-bottom: 10px;
}
#ArticlePic { /***文章缩略图定义***/
float: left; width: 120px;
background: #fff; clear : left;
}
#ArticleIntro { /***文章简介定义***/
float: right; width: 340px;
text-align: left;line-height: 150%;
color: #333;
}
#UpdateTime { /***文章发表时间定义***/
height: 30px; width: 100%;
text-align: right; font-size: 12px; color: #333;
border-bottom: 1px solid #f2f2f2;
}

  没有用“clear ”这个属性(是否允许两边可以有浮动对象),那先都加上“clear : both;”试试:

#ArticleList h3,
#ArticleList h3 a { /***文章标题定义***/
text-align: left;
font-size: 16px; color: #0055FF;
font-weight: bold;
margin-top: 30px; margin-bottom: 0px;
clear : both;
}
#ArticleList h3 a:hover { /***鼠标在链接上文章标题样式定义***/
font-size: 16px; color: #bb0000; background: #f2f2f2;
}
#ArticleSubheading { /***文章副标题定义***/
font-size: 14px; color: #aaa;
text-align: left; margin-bottom: 10px;
clear : both;
}
#ArticleSubheading2 { /***文章副标题定义***/
font-size: 14px; color: #aaa;
text-align: center; margin-bottom: 10px;
}
#ArticlePic { /***文章缩略图定义***/
float: left; width: 120px;
background: #fff;
clear : left;
}
#ArticleIntro { /***文章简介定义***/
float: right; width: 340px;
text-align: left;line-height: 150%;
color: #333;
}
#UpdateTime { /***文章发表时间定义***/
height: 30px; width: 100%;
text-align: right; font-size: 12px; color: #333;
border-bottom: 1px solid #f2f2f2;
clear : both;
}

  加上“clear : both;”保存后浏览,OK,都解决了:)

Mozilla Firefox中浏览的效果:

clear属性:
  clear 属性是定义否允许两边可以有浮动对象的一个属性,它有4个值:
  none :  允许两边都可以有浮动对象
  both :  不允许有浮动对象
  left :  不允许左边有浮动对象
  right :  不允许右边有浮动对象

  但这样定位为“clear : both;”则本不锈钢容器等中的首行内不准许另外的女朋友有波动女朋友;但这样定位为“clear : left;”则本不锈钢容器等中的下侧不准许另外的女朋友有波动女朋友。象“#ArticlePic”(缩图定位),其定位寻常不许够为“clear : right;”,因此文本框就不许够建立右超重低音了。
【打印正文】 发布的期限:2006-09-25 19:08:54 浏览次数: 做者:雅虎 源于:受美国法律亚无
×

用户登录

var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?90c4d9819bca8c9bf01e7898dd269864"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); !function(p){"use strict";!function(t){var s=window,e=document,i=p,c="".concat("https:"===e.location.protocol?"https://":"http://","sdk.51.la/js-sdk-pro.min.js"),n=e.createElement("script"),r=e.getElementsByTagName("script")[0];n.type="text/javascript",n.setAttribute("charset","UTF-8"),n.async=!0,n.src=c,n.id="LA_COLLECT",i.d=n;var o=function(){s.LA.ids.push(i)};s.LA?s.LA.ids&&o():(s.LA=p,s.LA.ids=[],o()),r.parentNode.insertBefore(n,r)}()}({id:"K9y7iMpaU8NS42Fm",ck:"K9y7iMpaU8NS42Fm"});