Monday, March 20, 2023

How to use HTML
Tag in the code

 

    The HTML <details> tag is used to create a disclosure widget in a web page. The widget consists of a summary and a details element. When a user clicks on the summary, the details element is revealed or hidden.

Here's an example of how to use the <details> tag :-


<details>

  <summary>Click to expand</summary>

  <p>These are the detail that are revealed when the summary is clicked.</p>

</details>


    In the example above, the summary element contains the text "Click to expand". When the user clicks on this text, the details element containing the paragraph element is revealed.

    You can add any type of content inside the details element, including images, videos, lists, and more.


(Note :- Copy this code and paste it in notepad and then save it as filename.html and then open the file in any browser.)

No comments:

Post a Comment