&LT峰; br>不会在Chrome上造成新行 [英] <br> not causing new line on Chrome

查看:158
本文介绍了&LT峰; br>不会在Chrome上造成新行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



通过添加 ZERO WIDTH SPACE 到容器元素,如下所示:

  div:after {content:'\0200B'; } 

这确保了最后一个< br>之后会有一些内容; 发生,有效地进入新行。无需添加/更改任何DOM。


Example page

I have some <span> elements which are inline-block and after the last <span> I have a <br> to break a new line (could be more than just one <br>).

The new line works on Firefox but doesn't work on Chrome (v. 24). Don't know why.

I write this so people who are searching the internet would have something to read regarding this matter, because I did not find anything on google/stackoverflow regarding this.

解决方案

Solved: http://jsbin.com/ezatoy/32/edit

By adding a ZERO WIDTH SPACE to the container element like so:

div:after{ content:'\0200B'; }

This insures that there will be some content after the last <br> occurrence, effectively breaking into a new line. no need to add/change any DOM.

这篇关于&LT峰; br&GT;不会在Chrome上造成新行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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