title: Make modal without Javascript
body: <p>How to make modal without javascript code with just html and css?</p>
  
  <p>I have a project that I can't use javascript and I need modal.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;title&gt;W3.CSS&lt;/title&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
  &lt;link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"&gt;
  &lt;body&gt;
  
  &lt;div class="w3-container"&gt;
    &lt;h2&gt;W3.CSS Modal&lt;/h2&gt;
    &lt;button onclick="document.getElementById('id01').style.display='block'" class="w3-button w3-black"&gt;Open Modal&lt;/button&gt;
  
    &lt;div id="id01" class="w3-modal"&gt;
      &lt;div class="w3-modal-content"&gt;
        &lt;div class="w3-container"&gt;
          &lt;span onclick="document.getElementById('id01').style.display='none'" class="w3-button w3-display-topright"&gt;&amp;times;&lt;/span&gt;
          &lt;p&gt;Some text. Some text. Some text.&lt;/p&gt;
          &lt;p&gt;Some text. Some text. Some text.&lt;/p&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>