UI

CSS中文字跑出DIV外面

主要是IE 注释BUG 去掉<!–xxxx–>相关注释

错误产生的原因和浮动也有关系,记得要关闭浮动的元素。注释的越多,溢出的字越多。

你也可以插入空的标记来解决!比如我下面放了个<p>元素

范例
<style type=”text/css”>
#layout{
margin: 0 auto;
width: 600px;
}
#main{
background: #FFEBCD;
float: left;
width: 400px;
height: 500px;
}
#right{
background: #6495ED;
float: left;
width: 200px;
height: 500px;
}
–>
</style>

<!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" lang="zh-CN">
<head>
<title></title>
<style type="text/css">
#layout{
 margin: 0 auto;
 width: 600px;
}
#main{
 background: #FFEBCD;
 float: left;
 width: 400px;
 height: 500px;
}
#right{
 background: #6495ED;
 float: left;
 width: 200px;
 height: 500px;
}
-->
</style>
</head>
<body>
<div id="layout">
<div id="main"></div>


  <!-- 注释 -->  <!-- 注释 -->  <!-- 注释 -->  <!-- 注释 -->  <!-- 注释 -->
  <div id="right">溢出溢出溢出溢出溢出溢出溢出溢出溢出溢出溢出溢出溢出溢出溢出溢出溢出溢出</div>

</div>
</body>
</html>
分类: UI

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理

相关文章

开始在上面输入您的搜索词,然后按回车进行搜索。按ESC取消。

返回顶部