×
   ❮     
HTML CSS MySql Javascript SQL PYTHON JAVA C++ C# BOOTSTRAP REACT XML NODEJS ANGULAR DJango Rust Android VUE
     ❯   

HTML Details tag


Details tag in HTML:

"Details" HTML tag is used to create a pull-down widget which enables you to show or disclose additional content once a user interacts with it.

It is very often used in order to let sections containing information expand and retract.

Clicking on "Details" tag is like a virtual reveal or hide button. It is also used to develop the accordion that expands on click to show more info.

Example

Let's use the "Details" tag to create an expandable section with additional details about a product:

Example

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Tanzania Programmers Services</title>
  <style>
    body {
      font-family: 'Arial', sans-serif;
      text-align: center;
      margin-top: 50px;
      font-size: 18px;
    }
    details {
      width: 50%;
      margin: auto;
      border: 1px solid #3498db; /* Blue color for details border */
      border-radius: 5px;
      padding: 10px;
      margin-top: 20px;
    }
    summary {
      font-size: 24px;
      font-weight: bold;
      cursor: pointer;
    }
    p {
      margin-top: 10px;
    }
  </style>
</head>
<body>
  <details>
    <summary>Tanzania Programmers Services</summary>
    <p>Visit: <a href="https://learnfasta.com/">Learnfasta.com</a></p>
    <p>Visit: <a href="https://solutionfasta.com/">Solutionfasta.com</a></p>
  </details>
</body>
</html>
Try it Yourself »

Hey there! Let's go for Learn fasta then! It is more than just coding; it is to have the superpower that can solve any problem. Through simple and easy-to-grasp examples you will sail through the learning process. In addition, it is not just about coding– you will acquire competencies on how to solve complex problems, analyze data, and come up with efficient solutions. Shall we start this wonderful journey together! learnfasta.com terms of use, Copyright 2025 All Rights Reserved.
O