Page 160 - HTML5
P. 160

</a>
             <button onclick="alert('Hello!');">Say Hello!</button>
             <p>My favorite language is <b>HTML</b>. Here are my others:</p>
             <ol>
                 <li>CSS</li>
                 <li>JavaScript</li>
                 <li>PHP</li>
             </ol>
         </div>


        Notice how every element has an opening tag, a closing tag, and text or other elements inside
        the opening and closing tags. Void tags however, are shown in the example below:


         <img src="https://cdn.sstatic.net/Sites/stackoverflow/company/img/logos/so/so-icon.png" />
         <br>
         <hr>
         <input type="number" placeholder="Enter your favorite number">


        With the exception of the img tag, all of these void elements have only an opening tag. The img
        tag, unlike any other tag, has a self closing / before the greater than sign of the opening tag.
        It is best practice to have a space before the slash.

        Read Void Elements online: https://riptutorial.com/html/topic/1449/void-elements



























































        https://riptutorial.com/                                                                             144
   155   156   157   158   159   160   161   162   163