Default css for custom html tags?

给你一囗甜甜゛ 提交于 2021-02-07 17:30:05

问题


I sometimes use custom html tags as containers for other elements:

<message-panel></message-panel>

Does an unknown element like the above have a default set of styles, common among the major browsers?

And, is it possible to set a default style for all unknown elements on a page?


回答1:


All unknown elements have a computed display value of “inline” source

You can use

* { ... }

for all elements, however this means that you overwrite anything non-specific set for default elements too.

It's better to keep to using HTML5 defined tags unless you're doing something along the lines of webcomponents.



来源:https://stackoverflow.com/questions/51438458/default-css-for-custom-html-tags

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