Word换行不适用于chrome中的字段集内的div [英] Word-wrap doesn't apply to div inside fieldset in chrome

查看:125
本文介绍了Word换行不适用于chrome中的字段集内的div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在linux chrome 27.0.1453.93和windows chrome 27.0.1453.94中试过。 http://jsfiddle.net/SruNd/4/ 中的示例。



CSS

  .main {
width:100px;
border:1px solid#000;
word-wrap:分词;

HTML

 < div class ='main'> 
< fieldset>
< div>
http://www.aaa.com/bbb/ccc/ddd/eee/fff/ggg
< / div>
< / fieldset>
< / div>

我也试过这种情况,word-wrap属性直接应用于内部div, fieldset是一个块元素。



在我看来,它就像一个铬错误,因为我在FireFox中也尝试过这种方法,并且它应该在斜杠上包装,并且没有该字段也可以在Chrome中正确执行此操作。

我试图提交铬错误报告,但由于HTTP请求错误格式错误,此页面现在不接受我的提交。

如果有人有任何见解,请帮助。谢谢。

解决方案

在字段集标记上使用此字段:

  fieldset 
{
min-width:auto;
}

事实上,这是由于chrome字段集的默认属性造成的: p>

  min-width:-webkit-min-content; 


Tried in linux chrome 27.0.1453.93 and windows chrome 27.0.1453.94. Example at http://jsfiddle.net/SruNd/4/.

CSS

.main {
    width : 100px;
    border : 1px solid #000;
    word-wrap: break-word;
}

HTML

<div class='main'>
    <fieldset>
        <div>
            http://www.aaa.com/bbb/ccc/ddd/eee/fff/ggg
        </div>
    </fieldset>
</div>

I've also tried this where the word-wrap property is applied directly to the inner div and the fieldset is a block element.

It seems to me like a chrome bug as I've also tried this in FireFox and it wraps as it should on the slashes, and without the fieldset it also does this correctly in Chrome.

I tried to submit a chrome bug report however the page is not accepting my submission right now due to a malformed HTTP request error.

If someone has any insight please help. Thank you.

解决方案

Use this on fieldset tag:

fieldset
{
    min-width: auto;
}

In fact, this is due to the chrome's default property for fieldset :

min-width: -webkit-min-content;

这篇关于Word换行不适用于chrome中的字段集内的div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆