问题
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