0

I can't workout how to get the second paragraph to display in this example code. I've only tried it in Firefox.

<!DOCTYPE html>
<html>
<head>
<style>
body {
    display: none;
}
.show {
    display: initial;
}
</style>
</head>
<body>

<p>para 1</p>
<div class="show">
    <p>para 2</p>
</div>
</body>
</html>
rajesh
  • 1,475
  • 10
  • 23

2 Answers2

1

body{
  visibility:hidden}
.show {
  visibility: visible;
  }
<p>para 1</p>
<div class="show">
    <p>para 2</p>
</div>

you can try this instead

GvM
  • 1,685
  • 11
  • 13
0

I'm going with this:

p {display: none} .show p {display: initial}

It's more work for me, but it does what I want. Thanks.