2

Admittedly, this is more out of curiosity than any practical relevance, but I trying to address the case when a browser has disabled CSS.

I have a <div> containing a <svg> but that element makes little sense without some CSS magic. Is there any way I could hide it with plain HTML which could be undone for browsers which allow CSS?

My best option right now is

<div><svg width="0" height="0"></svg></div> 

which leaves an "empty" <div> with lineheight: 1.

0

1 Answer 1

-1

If CSS isn't allowed, I would detach de DOM element through JS.

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

2 Comments

The question is how would they know.
Ops, sorry, well, in that case I would test something like establishing a width (for example) with CSS and then testing if there's a correspondence between that stablished value and the one obtained with getComputedStyle().

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.