Simple Accordions with HTML5 tags:
HTML File:
<div id="container">
<details class="box">
<summary class="title">
Heading One
</summary>
<p>
content here.......
</p>
</details>
<details class="box">
<summary class="title">
Heading Two
</summary>
<p>
content here.......
</p>
</details>
<details class="box">
<summary class="title">
Heading Three
</summary>
<p>
content here.......
</p>
</details>
</div>
This CSS Properties is useful for background color,width,height,border. we can develop basic accordions without this below CSS properties.
CSS Properties :
#container{
width: 500px;
height: auto;
background: #F2F2F2;
border: 1px solid #999;
}
.box{
width: 500px;
height: auto;
background: #ccc;
border: 1px solid #999;
}
.title{
height: 30px;
background: #999;
cursor: pointer;
}
No comments:
Post a Comment