5

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?

4
  • 1
    you cannot target all unknown tags only via CSS. Why can't you simply style the set of tags you use one-by-one? can't be that many. Commented Jul 20, 2018 at 8:41
  • You could style all unknown elements using javascript, but...it's ugly Commented Jul 20, 2018 at 8:54
  • This post is a non sense, all answers to the question got downvote. Commented Jul 20, 2018 at 9:10
  • I could certainly style each tag separately. I'm just curious if it is necessary, and perhaps also how much styling I need to add as a minimum. Commented Jul 21, 2018 at 11:48

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.