如何定位嵌套的div

时间:2016-03-06 10:37:56

标签: html css



<div style="display:inline-block;border:1px solid blue;position:relative;">
  <div style="display:inline-block;border:1px solid red;float:left;">Some words here!!!</div>
  <div id="Pleasedontmovetoleftsideandstayput" style="display:inline-block;float:left;border:1px solid green;">
    <div style="width:100px;height:30px;display:block;float:left;">Some words here!!!Some words here!!!Some words here!!! </div>
    <div style="width:100px;height:30px;display:block;float:left;">Some words here!!!Some words here!!!Some words here!!! </div>
    <div style="width:100px;height:30px;display:block;float:left;">Some words here!!!Some words here!!!Some words here!!! </div>
    <div style="width:100px;height:30px;display:block;float:left;">Some words here!!!Some words here!!!Some words here!!! </div>
    <div style="width:100px;height:30px;display:block;float:left;">Some words here!!!Some words here!!!Some words here!!! </div>
    <div style="width:100px;height:30px;display:block;float:left;">Some words here!!!Some words here!!!Some words here!!! </div>
    <div style="width:100px;height:30px;display:block;float:left;">Some words here!!!Some words here!!!Some words here!!! </div>
    <div style="width:100px;height:30px;display:block;float:left;">Some words here!!!Some words here!!!Some words here!!! </div>
    <div>  
    </div>
  </div>
</div>
&#13;
&#13;
&#13;

我希望#Pleasedontmovetoleftsideandstayput保持不变,当我不断向其添加内容时,不要向左移动。当我向其添加内容并在行尾到达时,它会展开并向左移动以填充100%的行,这是我不想要的。

0 个答案:

没有答案