Professional Documents
Culture Documents
Step3: LINK ur CSS file with HTML file by add the bellow line in
your HTML document inside <head> tag
<link rel="stylesheet" type="text/css" href="FileName.css">
<html>
<head>
<meta charset="utf-8">
<title>CSS Accordian</title>
<link rel="stylesheet" type="text/css" href="Accordian.css">
<div class="accordian">
Creating a div with class name =
<div class="accordian-tab"> accordion-tab
<div class="accordian-content">
<p> Any thing you want to write any text you want to write this is a
paragraph. Any thing you want to write any text you want to write this
is a paragraph. Any thing you want to write any text you want to write
this is a paragraph.</p> </div> </div>
<div class="accordian-tab">
<input type="checkbox" id="toggle2" class="accordian-
toggle" name="toggle">
<label for="toggle2">Any TEXT</label>
<div class="accordian-content">
<p> Any thing you want to write any text you want to write this is a
paragraph. Any thing you want to write any text you want to write this
is a paragraph. Any thing you want to write any text you want to write
this is a paragraph.</p>
</div>
</div>
You can copy paste the above code incide the box as many time you
want to get depends on how many lable you want JUST CHANGE
id="toggle2,3,4,5……" & for="toggle2,3,4,5……."
Respectively.
</div> </body> </html>
AFTER HTML YOUR FILE LOOK LIKE THIS…… NOW CSS PART
NOW CSS
INSIDE CSS FILE
*{ *(STAR) is a universal selector
body{
background-image: url(image.jpg);
background-size: cover;
background-attachment: fixed;
font-family: arial,sans-serif;
.content{
width: 70%;
padding: 40px;
border-radius: 10px;
}
.accordian{
width: 60%;
margin: 50px;
background: #fff;
font-size: 16px;
line-height: 24px
font-weight: bold;
position: relative;
given so that we can apply
position: relative;
animation in the label
display: block;
display: block; given to get a properties of
padding: 12px 20px;
block & so that every label align vertically
cursor: pointer; below each other
border-top: 1px solid #ddd; It will make the mouse cursor to pointer
(hand symbol cursor)
}
line-height: 20px;