-1
<!DOCTYPE html>
<html>
<body>

<p style="hidden: true;" id="demo">Hello!</p>

</body>
</html>

Why doesn't hidden: true; hide the paragraph? I can see it on the web page

2 Answers2

1

Try using visibility: hidden; for your style or you can use the hidden attribute like this

<p hidden>Hello!</p>
Stefan Joseph
  • 545
  • 2
  • 10
0

hidden: true is not a valid css attribute

use:

<p style="display: none;" id="demo">Hello!</p>

this means that the tag will not appear on the page and there will be no space allocated

or:

<p style="visibility: hidden;" id="demo">Hello!</p>

this means that the tag is not visible, but space is allocated for it.

GiampaoloGabba
  • 1,428
  • 1
  • 15
  • 21