
- 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 vertical "button group" with CSS?
Following is the code to produce vertical button group using CSS −
Example
<!DOCTYPE html> <html> <style> *,*::before,*::after{ box-sizing: border-box; } .btnGroup{ display: inline-block; font-size: 0; border: 2px solid darkgreen; box-shadow: 5px 10px 18px rgb(55, 173, 39); } button{ display: block; width: 100%; margin:0px; border:none; padding: 15px; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; font-weight: bold; font-size: 20px; } button:not(:last-child){ border-bottom: 2px solid rgb(6, 134, 49); } button:hover{ background:rgb(48, 24, 134); box-shadow: 5px 10px 18px rgb(41, 39, 173); color:white; } </style> <body> <h1>Button Group</h1> <div class="btnGroup"> <button>Facebook</button> <button>Twitter</button> <button>LinkedIn</button> </div> <h2>Hover over the above button group to see hover effects</h2> </body> </html>
Output
The above code will produce the following output −
On hovering above any of the buttons −
- Related Articles
- Create a Vertical Button Group with CSS
- How to create a "button group" with CSS?
- Create a Button Group with CSS
- Create a Bordered Button Group with CSS
- How to create a vertical menu with CSS?
- How to create a vertical line with CSS?
- How to create a "more" button with CSS?
- How to create a search button with CSS?
- Create a Button Group with Bootstrap
- How to create vertical button column with GridLayout in Java?
- How to create a split button dropdown with CSS?
- Create a small button group with Bootstrap
- Create a large button group with Bootstrap
- How to create a vertical tab menu with CSS and JavaScript?
- How to create a "scroll back to top" button with CSS?

Advertisements