Internet Explorer (IE11) ignores CSS break-inside: avoid
Change in your container display: flex to display:inline-flex and it works in ie:
.container {
display: -webkit-inline-flex; /* Safari */
display: inline-flex;
}
https://scotch.io/tutorials/a-visual-guide-to-css3-flexbox-properties
CSS columns break elements apart in Chrome even with break-inside:avoid;
This is due to a lack of support. From caniuse.com:
WebKit- and Blink-based browsers do have equivalent support for the
non-standard -webkit-column-break-* properties to accomplish the same
result (but only the auto and always values)
Update
It means the -webkit-column-break-inside: avoid;
is not supported in WebKit- and Blink-based browsers, like Chrome (as it is WebKit-based).
CSS Paged Media: Cannot achieve desired breaking behaviour (break-after, break-before doing nothing)
After giving up for just about two years and only just now deciding to look into this again, I've found my answer. The problem comes from the fact that my document uses CSS Grid to lay content out side-by-side. As per this answer, the W3 specification for this sort of behaviour is still in the candidate stage.
So, it looks like I was just a little bit ahead of the curve. At the very least, there doesn't seem to be anything wrong with the CSS code itself /p>
CSS Page Break Before (Left & Right) Not Working
It looks like the only browsers that currently support:
page-break-before: left|right
page-break-after: left|right
Are Internet Explorer, Edge, and Opera Mini
(Source: http://caniuse.com/#feat=css-page-break)
Other browsers typically default to "always" if "left" or "right" is used which explains the results in the initial question.
How to fix IE support for line break using CSS pseudo-element?
IE 11 recognizes the :before
pseudo-element, but it just does not render a pseudo-element that contains nothing but a line break. Whether this is correct is an interesting question, but to circumvent the issue in your case, put e.g. a no-break space (U+00A0) there before the line break. That is, replace content: "\a"
by content: "\a0\a"
.
On the other hand, it would be easier and more flexible to set a top margin on the h3
element rather than use generated content to add an empty line.
I don’t know why IE dev tools show the settings as struck-through. This seems to be a bug/feature in those tools, since the strike-through appears even when the code is modified as suggested above, in which case the CSS has visible effect. The same applies to using, say, content: "*"
for testing.
Related Topics
Tweaking Bootstrap 2.0 for Semantic Markup
Offset Scroll Anchor in HTML with Bootstrap 4 Fixed Navbar
Svg "Fill: Url(#....)" Behaving Strangely in Firefox
CSS Percentage Width and Text-Overflow in a Table Cell
Twitter Bootstrap 3 How to Activate Navbar-Collapse on Small Devices
How to Define a Less Mixin to Generate a Transition-Property with a Variable Number of Parameters
CSS - Circle with Margin on Border
@Font Face Choppy Font in Chrome
Use CSS to Hide Contents on Print
How to Get Cross Browser Compatibility in Print on Page from All Browsers
Best Way to Use Media Queries for Mobile Designs
How to Change Bootstrap 3's Glyphicons to White
Calc() Function Inside Another Calc() in CSS
How to Change Svg Fill Color When Used as Base-64 Background Image Data
What Is the Current State of Sub-Pixel Accuracy in the Major Browsers