DropDownAnimation

## **Drop down box animation**

 Title Text Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Menu example (you'll have to play with the width and sizing of this code to get it how you want exactly)
Title Text
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Title Text
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

### WikiCode:

<div class="dropdownanimation"> <div class="title">Title Text</div> <div class="content">Additional Text that appears on hover.</div> </div>

### css:

```
.dropdownanimation {
  width: 300px; /* "button" width */
  height: 50px; /* "button" height */
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: black;
  color: white; /* text colour */
  cursor: pointer; /* Add a pointer cursor on hover */
  transition: height 0.5s ease; /* transition height change */
  overflow: hidden; /* Hide overflowing content */
  position: relative;
}

.title,
.content {
  width: 100%;
  overflow-wrap: break-word;
  text-overflow: ellipsis;
  white-space: pre-wrap; /* Makes the text not exceed the box size */
  max-width: 100%;
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%); /* Center the text vertically and horizontally */
  transition: opacity 0.5s ease; /* Add smooth transition for opacity */
}

.title {
  opacity: 1; /* Initially show the title */
  top: 50%; /* Makes the title text center */
  font-size: 1.5em;
  text-align: center;
}

.content {
  opacity: 0; /* Initially hide the content */
  top: 50%;
  font-size: 1em;
  padding: 20px;
  text-align: left;
}

.dropdownanimation:hover {
  height: 700px; /* Expanded height on hover */
}

.dropdownanimation:hover .title {
  opacity: 0; /* Hide the title on hover */
}

.dropdownanimation:hover .content {
  opacity: 1; /* Show the content on hover */

}

```