我将设置元素的宽度。
元素将包装其中的任何文本
但是,如果您将div标签宽度设置为小于div标签中无法包装的某些元素,则div标签不会比该元素小
基本上,它应该像普通的html元素一样工作
只要宽度不小于不会包裹的宽度,就应该允许设置宽度

http://jsbin.com/taxawopace/1/edit?html,output
请检查一下
如您所见,错过了背景颜色。
我该怎么办?
谢谢

HTML / CSS:

  <div class="map-data-dialog" id="map-data-dialog" style="display: block; position: relative; z-index: 111111; border-color: rgb(23, 56, 14); width: 40px; color: rgb(1, 1, 1); left: 10px; top: 10px; background: rgb(218, 218, 218); padding: 12px;">
    <div class="map-data-box clearfix" style="font-family: arial; font-size: 18.3px; font-weight: 600; min-width: 40px;">
        <h3 class="map-title" style="font-family: arial; font-size: 18.3px; font-weight: 600;">test</h3>
        <div class="map-content" style="font-family: arial; font-size: 18.3px; font-weight: 600;"><div style="color: red; font-weight: 600; font-size: 18.3px; font-family: arial;">for testing method</div><p style="font-family: arial; font-size: 18.3px; font-weight: 600;">this is easy listenning for business</p></div>
    </div>
</div>

最佳答案

word-break:break-all;添加到div映射数据框中,以使文本分解为适合div的格式。

09-10 11:32
查看更多