HTML5 <details> Tag



Details tag is a new feature in HTML5.








HTML5

The details tag displays the additional information which a user can open to see or even has the power to hide the content. We can put any kind of content in it, for example we can show unordered list, ordered list or  even the plain text.

If we want  the content under the details tag to be already open so that user need not open it we have to use the open attribute otherwise the content will not be visible to the user.

About the <summary> Tag

Summary tag is used to give the user some idea about the content that is hidden which means it just acts as a heading for the hidden content.
BASIC HTML & CSS

<!DOCTYPE html>

<html>
<head>
<meta charset=utf-8 />
<title>thewwwdesigners</title>
<style>
body { 
font-family: sans-serif; 
}
details {
overflow: hidden;
background: #e4e4e4;
}
details summary {
cursor: pointer;
padding: 10px;
}
details div {
float: left;
width: 65%;
}
details div h3 { 
margin-top: 0; 
}
</style>
</head>
<body>
<details>
<summary>About The Author</summary>
<div>
<h3>Anirudh Thakur</h3>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p> 
</div>
</details>


</body>
</html>