To create a drop-down menu in CSS, you’ll need to use both HTML and CSS. You’ll create an HTML file to structure the menu and a CSS file to style it.
Here’s a simple example:
HTML:
```
CSS:
```
.dropdown-menu {
list-style-type: none;
margin: 0;
padding: 0;
}
.dropdown-menu li {
display: inline-block;
position: relative;
}
.dropdown-menu li a {
display: block;
padding: 10px;
text-decoration: none;
background-color: #FFFFFF;
color: #000000;
}
.dropdown-menu li ul {
display: none;
position: absolute;
top: 100%;
}
.dropdown-menu li:hover ul {
display: block;
}
.dropdown-menu li ul li {
display: block;
padding: 5px;
background-color: #FFFFFF;
color: #000000;
}
```
This code will create a drop-down menu with two main options (“Menu 1” and “Menu 2”) live. When you hover over each main option, its associated submenus (“Submenu 1.1”, “Submenu 1.2”, etc.) will be displayed.