dropdown menu css
CSS
<!-- Answer to: "drop down menu html" -->
<label for="items">Choose an item:</label>
<select id="things">
<option value="thing-1">Thing 1</option>
<option value="thing-2">Thing 2</option>
<option value="thing-3">Thing 3</option>
<option value="thing-4">Thing 4</option>
</select><style>
/* Style The Dropdown Button */
.dropbtn {
background-color: #4CAF50;
color: white;
padding: 16px;
font-size: 16px;
border: none;
cursor: pointer;
}
/* The
container <div> - needed to position the dropdown content */
.dropdown {
position: relative;
display:
inline-block;
}
/* Dropdown Content (Hidden by Default) */
.dropdown-content {
display: none;
position:
absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow:
0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
/* Links inside the dropdown */
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
/* Change color of dropdown links on hover */
.dropdown-content a:hover {background-color: #f1f1f1}
/* Show the
dropdown menu on hover */
.dropdown:hover .dropdown-content {
display: block;
}
/* Change the background color of the dropdown
button when the dropdown content is shown */
.dropdown:hover .dropbtn {
background-color: #3e8e41;
}
</style>
<div class="dropdown">
<button class="dropbtn">Dropdown</button>
<div class="dropdown-content">
<a href="#">Link
1</a>
<a href="#">Link 2</a>
<a href="#">Link 3</a>
</div>
</div> <!DOCTYPE html>
<html>
<head>
<style>
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
padding: 12px 16px;
z-index: 1;
}
.dropdown:hover .dropdown-content {
display: block;
}
</style>
</head>
<body>
<h2>Hoverable Dropdown</h2>
<p>Move the mouse over the text below to open the dropdown content.</p>
<div class="dropdown">
<span>Mouse over me</span>
<div class="dropdown-content">
<p>Hello World!</p>
</div>
</div>
</body>
</html>
Also in CSS:
- Title
- html css how to arrange images of different sizes
- Category
- CSS
- Title
- css inherit class
- Category
- CSS
- Title
- common css media queries
- Category
- CSS
- Title
- difference between :after and ::after
- Category
- CSS
- Title
- css border width
- Category
- CSS
- Title
- line spacing css
- Category
- CSS
- Title
- css change background color of page
- Category
- CSS
- Title
- ms-clear event
- Category
- CSS
- Title
- css no overflow
- Category
- CSS
- Title
- css keyframes animation
- Category
- CSS
- Title
- ggo
- Category
- CSS
- Title
- center ul
- Category
- CSS
- Title
- mobile tablet desktop media queries
- Category
- CSS
- Title
- using foundation css to add social media links
- Category
- CSS
- Title
- external css
- Category
- CSS
- Title
- css hide mark border
- Category
- CSS
- Title
- move table css
- Category
- CSS
- Title
- css disabled div
- Category
- CSS
- Title
- underline text using css
- Category
- CSS
- Title
- remove bullets from list css
- Category
- CSS
- Title
- css selenium
- Category
- CSS
- Title
- use css in cshtml
- Category
- CSS
- Title
- css onclick change color
- Category
- CSS
- Title
- css transition on hover
- Category
- CSS
- Title
- line-height not working
- Category
- CSS
- Title
- css play button on image
- Category
- CSS
- Title
- a active css
- Category
- CSS
- Title
- set items inline html
- Category
- CSS
- Title
- remove html scroll bar
- Category
- CSS
- Title
- scss to css
- Category
- CSS
- Title
- remove css jquery
- Category
- CSS
- Title
- zoom css
- Category
- CSS
- Title
- css list style url siz
- Category
- CSS
- Title
- get element with href css
- Category
- CSS
- Title
- how to bold in css
- Category
- CSS
- Title
- rel css
- Category
- CSS
- Title
- simple font-face mixin scss
- Category
- CSS
- Title
- css child multiple of 3
- Category
- CSS
- Title
- css border
- Category
- CSS
- Title
- css perspective
- Category
- CSS
- Title
- css fade out
- Category
- CSS
- Title
- css font style
- Category
- CSS
- Title
- col-xs-12 col-sm-4 col-md-4 col-lg-4
- Category
- CSS
- Title
- tint image with background color css
- Category
- CSS
- Title
- how to change hyperlink color in css
- Category
- CSS
- Title
- background image overlay
- Category
- CSS
- Title
- enter in css
- Category
- CSS
- Title
- js ransform css
- Category
- CSS
- Title
- how to specify amout of letters in inputfield in css
- Category
- CSS
- Title
- kotlin exit app
- Category
- CSS
- Title
- transparent text css
- Category
- CSS
- Title
- css push div down
- Category
- CSS
- Title
- css inputs outofill color
- Category
- CSS
- Title
- remove arrows from input type number
- Category
- CSS
- Title
- laavel relation through morph
- Category
- CSS
- Title
- image orientation css
- Category
- CSS
- Title
- outline bottom css
- Category
- CSS
- Title
- resize in css
- Category
- CSS
- Title
- header html css
- Category
- CSS
- Title
- css attribute selector
- Category
- CSS
- Title
- DevTools failed to load SourceMap: Could not load content for bootstrap.min.css.map
- Category
- CSS
- Title
- css rounded corners at top only
- Category
- CSS
- Title
- how to apply different properties to different paragraphs in css
- Category
- CSS
- Title
- lier class et css
- Category
- CSS
- Title
- free css templates
- Category
- CSS
- Title
- text wrap image wordpress css
- Category
- CSS
- Title
- css reset margin padding
- Category
- CSS
- Title
- how to add toggle class in javascript using css modules
- Category
- CSS
- Title
- print zend db select query to string
- Category
- CSS
- Title
- css for chrome only
- Category
- CSS
- Title
- hide the default tooltip behaviour from safari
- Category
- CSS
- Title
- css paragraph ellipsis
- Category
- CSS
- Title
- flex-wrap: wrap
- Category
- CSS
- Title
- scss @mixin base
- Category
- CSS
- Title
- general sibling selector
- Category
- CSS
- Title
- responsive images css
- Category
- CSS
- Title
- stop text from wrapping
- Category
- CSS
- Title
- how to make gradient backgroud cover whole page in html
- Category
- CSS
- Title
- vuetify background color
- Category
- CSS
- Title
- css last child with class
- Category
- CSS
- Title
- heading css styles
- Category
- CSS
- Title
- css remove blue outline button
- Category
- CSS
- Title
- center vertically and horizontally css
- Category
- CSS
- Title
- css grid area
- Category
- CSS
- Title
- animate font weight css
- Category
- CSS
- Title
- how do I add a vertical margin in css
- Category
- CSS
- Title
- how to change the page background in css
- Category
- CSS
- Title
- change the weight of a bold font css
- Category
- CSS
- Title
- background color css rgb
- Category
- CSS
- Title
- css responsive
- Category
- CSS
- Title
- css animation examples
- Category
- CSS
- Title
- how to change button gradient
- Category
- CSS
- Title
- css display none but take up space
- Category
- CSS
- Title
- hover transition css
- Category
- CSS
- Title
- move bullets in css
- Category
- CSS
- Title
- tailwindcss init full
- Category
- CSS
- Title
- detect if an element has a class jQurey
- Category
- CSS
- Title
- html font size
- Category
- CSS
- Title
- css set property with data attribute
- Category
- CSS
- Title
- css multiple classes
- Category
- CSS