HTML open Attribute


The HTML open attribute define the details HTML element content should be visible(open) in an HTML document.

Syntax

Following is the syntax −

<details open></details>

Let us see an example of HTML open Attribute −

Example

Live Demo

<!DOCTYPE html>
<html>
<style>
   body {
      color: #000;
      height: 100vh;
      background-color: #8BC6EC;
      background-image: linear-gradient(135deg, #8BC6EC 0%, #9599E2 100%);
      text-align: center;
   }
</style>
<body>
<h1>HTML low Attribute Demo</h1>
<details open>
<summary>Hi! I'm a summary element</summary>
<p>Hi! I'm a paragraph element with some dummy text</p>
</details>
</body>
</html>

Output

Updated on: 17-Feb-2021

67 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements