简体   繁体   English

浏览器还不支持column-break-after吗?

[英]column-break-after not supported to browsers yet?

I have html markup like this: 我有这样的html标记:

<ul>
  <li>
    <h2>heading</h2>
    <img src="path.jpg" />
    <p>paragraph here</p>
  </li>
  <li>
    <h2>heading</h2>
    <img src="path.jpg" />
    <p>paragraph here</p>
  </li>
....
</ul>

And I'm using multiple column layout for this: 我为此使用了多列布局:

ul{
column-count: 3;
}

But it's breaking column from anywhere but I want to avoid breaking from anywhere. 但这是从任何地方断开的列,但我要避免从任何地方断开。 It should break from li tag only 它应该只从li标签打破

So, I tried break-after https://developer.mozilla.org/en-US/docs/Web/CSS/break-after which seems not supporting. 所以,我试图break-after https://developer.mozilla.org/en-US/docs/Web/CSS/break-after这似乎不支持。 I'm using firefox 27.1. 我正在使用Firefox 27.1。


I've tried a lot using prefixes too. 我也尝试过使用前缀。

You should check out caniuse.com - a really useful place to see browser support for various HTML5 / CSS3 features. 您应该访问caniuse.com-一个非常有用的地方,以查看浏览器对各种HTML5 / CSS3功能的支持。

A quick search on there shows the support for CSS3 multiple column layouts - http://caniuse.com/#search=column%20layout - it looks like Firefox has partial support but you need to use the -moz prefix. 在那里快速搜索显示了CSS3多列布局的支持- http://caniuse.com/#search=column%20layout -它看起来像Firefox有部分支持 ,但你需要使用-moz前缀。

Amazingly, I put display: inline-block to li then it is not breaking after anywhere it is just breaking after li only but I don't know why this is happening to work. 令人惊讶的是,我将display: inline-block放到li处,那么它在任何地方都不会中断,而只是在li之后而中断,但是我不知道为什么这种情况会发生。 And no need to use break-after. 无需使用突破。

page-break-after and its replacement break-after (which subsumes the function of both page-break-after and column-break-after) have both been supported for years now by Internet Explorer 10+, and also by Opera. Internet Explorer 10+和Opera都已支持page-break-after和它的替换break-after (包括page-break-after和column-break-after的功能)。 It's only Chrome and Firefox that that are utterly broken in pagination support. 只有Chrome和Firefox在分页支持上被彻底打破。 Even Webkit supports the concept, naturally using its own special gleaming white syntax. 甚至Webkit都支持该概念,自然会使用其自己的特殊闪烁白色语法。

To the best of my knowledge, as an attribute in its own right column-break-after has only ever existed as -webkit-column-break-after , it has never been part of any CSS standard. 据我所知,作为其自身属性, column-break-after仅作为-webkit-column-break-after ,它从未成为任何CSS标准的一部分。

But hey, Internet Explorer is crap, right? 但是,嘿,Internet Explorer很糟糕,对吧? It doesn't support standards unless they're completely irrelevant to the real world, like basic pagination control for printing business reports. 它不支持标准,除非它们与现实世界完全无关,例如用于打印业务报告的基本分页控制。 Who would want to do that? 谁想这样做?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM