Alternative for display:contents in Chrome?

痞子三分冷 提交于 2020-12-08 07:08:32

问题


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.


回答1:


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; }
}


来源:https://stackoverflow.com/questions/48535296/alternative-for-displaycontents-in-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!