W3.CSS Dropdowns | CSS dropdown
W3.CSSDropdownClassesW3.CSSprovidesthefollowingdropdownclasses:ClassDefinesw3-dropdown-hoverAhoverabledropdownelementw3-dropdown-contentThedropdownparttobedisplayedw3-dropdown-clickAclickabledropdownelementDropdownElementsThew3-dropdown-hoverclassdefinesahoverabledropdownelement.Thew3-dropdown-contentclassdefinesthedropdowncontenttobedisplayed.Example
W3.CSS provides the following dropdown classes:
Class Defines w3-dropdown-hover A hoverable dropdown element w3-dropdown-content The dropdown part to be displayed w3-dropdown-click A clickable dropdown element Dropdown ElementsThe w3-dropdown-hover class defines a hoverable dropdown element.
The w3-dropdown-content class defines the dropdown content to be displayed.
Example<div class="w3-dropdown-hover"> <button class="w3-button">Hover Over Me!</button> <div class="w3-dropdown-content w3-bar-block w3-border"> <a href="#" class="w3-bar-item w3-button">Link 1</a> <a href="#" class="w3-bar-item w3-button">Link 2</a> <a href="#" class="w3-bar-item w3-button">Link 3</a> </div></div>
Try it Yourself »[1]
Both the hoverable element and the dropdown content element can be any HTML element.
In the example abo...