7

What is the alternate solution to implement the following in chrome.

display:contents;

Currently only firefox supports them in all versions.

Is there any other way to get the same features as this css tag.

enter image description here

Kayce Basques
  • 23,849
  • 11
  • 86
  • 120
FAntony
  • 534
  • 7
  • 22
  • 3
    Caniuse is out of date, it's said to be enabled in Chrome 65. https://www.chromestatus.com/feature/5663606012116992 https://crbug.com/657748 https://groups.google.com/a/chromium.org/d/topic/blink-dev/XzdNrEvn4Qk – Josh Lee Jan 31 '18 at 11:45
  • 1
    But thats possible when we enable it right? – FAntony Feb 01 '18 at 05:35
  • https://codepen.io/paulobrien/pen/jYYKmB appears to be doing it in browser without support for it. Tested in Chrome and works. Resize browser window. – tao Dec 05 '18 at 23:16

2 Answers2

2

You can use an alternative approach, instead using display:content (that is marked as experimental at the moment) you can create a container class and add the property display:grid, and, in case the browser supports display:content use it with this code:

@supports (display: contents) {
  article { display: contents; }
}
1
.display-contents {
    display: flex;
    flex-wrap: wrap;
}
Unzeabk
  • 11
  • 1