文字溢出问题&文字非包装

时间:2009-07-11 14:33:58

标签: css xhtml html xhtml-1.0-strict

方案: 一个标题DIV与三个DIV并排向左浮动。

问题: 来自HEADER_A div的“Text”溢出到HEADER_B DIV,依此类推。

截图/ CSS:

alt text http://thumb0.webshots.net/t/74/174/8/92/12/2239892120105349420zNlkOc_th.jpg

#header{
height:127px;
width: 718px;
}

#header_a {
    width:181px;
    height: 127px;
    color:#FFFFFF;
    float:left; 
}

#header_b{
width: 363px;
float:left;
height: 127px;
/*background-image:url(../images/logo.jpg);*/
background-position:bottom;
background-repeat:no-repeat;
background-color:#006600;
}

#header_c{
width: 174px;
float:left;
height: 127px;
}

<div id="header">
      <div id="header_a">ddddddddddddddddddddddddddddddddddddddddddddddddddddddd</div>
        <div id="header_b"></div>
        <div id="header_c"><img src="images/nuevo.png" /></div>
    </div>

1 个答案:

答案 0 :(得分:2)

ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd 181px。

它显然会溢出,因为它被视为一个单词并且单词没有被分解。尝试使用一些正确的文字或给出一些空间,如“ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd

编辑:

另一方面,

同样会发生在图像上。因此div中比其父级更大的任何内容都会溢出。您可以尝试使用'overflow:hidden'