<!DOCTYPE html>
<
html
lang
=
"en"
>
<
head
>
<
meta
charset
=
"UTF-8"
>
<
meta
http-equiv
=
"X-UA-Compatible"
content
=
"IE=edge"
>
<
meta
name
=
"viewport"
content
=
"width=device-width, initial-scale=1.0"
>
<
style
>
h1 {
color: green;
}
.wrapper #first {
max-height: 0px;
width: 15rem;
transition: max-height 0.50s ease-out;
overflow: hidden;
background: slateblue;
text-align: center;
}
.wrapper:hover #first {
max-height: 500px;
transition: max-height 0.50s ease-in;
}
.wrapper #second {
max-height: 0px;
width: 15rem;
transition: max-height 0.50s ease-out;
overflow: hidden;
background: pink;
text-align: center;
}
.wrapper:hover #second {
max-height: 600px;
transition: max-height 0.50s ease-in;
}
.wrapper #third {
max-height: 0px;
width: 15rem;
transition: max-height 0.50s ease-out;
overflow: hidden;
background: grey;
text-align: center;
}
.wrapper:hover #third {
max-height: 700px;
transition: max-height 0.50s ease-in;
}
.wrapper #fourth {
max-height: 0px;
width: 15rem;
transition: max-height 0.50s ease-out;
overflow: hidden;
background: burlywood;
text-align: center;
}
.wrapper:hover #fourth {
max-height: 800px;
transition: max-height 0.50s ease-in;
}
</
style
>
</
head
>
<
body
>
<
h1
>GeeksforGeeks</
h1
>
<
h3
>
How to transition height: 0; to
height: auto; using CSS?
</
h3
>
<
div
class
=
"wrapper"
>
<
a
>Hover to Reveal the first box.</
a
>
<
div
id
=
"first"
>
Hello Geek!!
<
br
>
This is the first Container
<
br
>
This is the first box content.
</
div
>
</
div
>
<
div
class
=
"wrapper"
>
<
a
>Hover to Reveal the Second box.</
a
>
<
div
id
=
"second"
>
Hello Geek!!
<
br
>
This is the Second Container
<
br
>
This is the Second box content.
</
div
>
</
div
>
<
div
class
=
"wrapper"
>
<
a
>Hover to Reveal the Third box.</
a
>
<
div
id
=
"third"
>
Hello Geek!!
<
br
>
This is the Third Container
<
br
>
This is the Third box content.
</
div
>
</
div
>
<
div
class
=
"wrapper"
>
<
a
>Hover to Reveal the Fourth box.</
a
>
<
div
id
=
"fourth"
>
Hello Geek!!
<
br
>
This is the Fourth Container
<
br
>
This is the Fourth box content.
</
div
>
</
div
>
</
body
>
</
html
>