
- CSS Tutorial
- CSS - Home
- CSS - Introduction
- CSS - Syntax
- CSS - Inclusion
- CSS - Measurement Units
- CSS - Colors
- CSS - Backgrounds
- CSS - Fonts
- CSS - Text
- CSS - Images
- CSS - Links
- CSS - Tables
- CSS - Borders
- CSS - Margins
- CSS - Lists
- CSS - Padding
- CSS - Cursors
- CSS - Outlines
- CSS - Dimension
- CSS - Scrollbars
- CSS Advanced
- CSS - Visibility
- CSS - Positioning
- CSS - Layers
- CSS - Pseudo Classes
- CSS - Pseudo Elements
- CSS - @ Rules
- CSS - Text Effects
- CSS - Media Types
- CSS - Paged Media
- CSS - Aural Media
- CSS - Printing
- CSS - Layouts
- CSS - Validations
- CSS3 Tutorial
- CSS3 - Tutorial
- CSS3 - Rounded Corner
- CSS3 - Border Images
- CSS3 - Multi Background
- CSS3 - Color
- CSS3 - Gradients
- CSS3 - Shadow
- CSS3 - Text
- CSS3 - Web font
- CSS3 - 2d transform
- CSS3 - 3d transform
- CSS3 - Animation
- CSS3 - Multi columns
- CSS3 - User Interface
- CSS3 - Box Sizing
- CSS Responsive
- CSS - Responsive Web Design
- CSS References
- CSS - Questions and Answers
- CSS - Quick Guide
- CSS - References
- CSS - Color References
- CSS - Web browser References
- CSS - Web safe fonts
- CSS - Units
- CSS - Animation
- CSS Resources
- CSS - Useful Resources
- CSS - Discussion
How to create a split button dropdown with CSS?
Following is the code to create split button dropdown with CSS −
Example
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" /> <style> body { font-family: "Lucida Sans", "Lucida Sans Regular", "Lucida Grande", "Lucida Sans Unicode", Geneva, Verdana, sans-serif; } button { background-color: rgb(18, 5, 95); color: white; padding: 16px; font-size: 20px; font-weight: bolder; font-family: monospace, sans-serif; border: none; outline: none; } .dropMenu { position: absolute; display: inline-block; } .dropMenu button { border-left: 1px solid #0d8bf2; } .dropContent { display: none; position: absolute; background-color: #f1f1f1; min-width: 160px; z-index: 1; } .dropContent a { color: black; background-color: rgb(184, 253, 255); font-size: 18px; font-weight: bold; padding: 12px 16px; text-decoration: none; display: block; } .dropContent a:hover { background-color: rgb(48, 0, 110); color: white; } .dropMenu:hover .dropContent { display: block; } .btn:hover, .dropMenu:hover .btn { background-color: #0b7dda; } </style> </head> <body> <h1>Split Button dropMenu Example</h1> <button>Button</button> <div class="dropMenu"> <button> >> </button> <div class="dropContent"> <a href="#">First Link</a> <a href="#">Second Link</a> <a href="#">Third Link</a> </div> <h1>Hover over '>>' to open dropMenu menu</h1> </body> </html>
Output
The above code will produce the following output −
n hovering above the dropdown button, the dropdown menu will open as shown −
- Related Articles
- How to create a hoverable dropdown menu with CSS?
- How to create a dropdown navigation bar with CSS?
- How to create a "button group" with CSS?
- How to create a "more" button with CSS?
- How to create a search button with CSS?
- How to create a clickable dropdown menu with CSS and JavaScript?
- How to create a responsive navigation bar with dropdown in CSS?
- How to create a vertical "button group" with CSS?
- How to create a split screen (50/50) with CSS?
- Create a Button Group with CSS
- Create a caret arrow icon that represents dropdown button with Bootstrap
- How to create a "scroll back to top" button with CSS?
- How to create a "toggle switch" (on/off button) with CSS?
- Create a Bordered Button Group with CSS
- Create a Vertical Button Group with CSS

Advertisements