
- 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 icon buttons with CSS?
Following is the code to create icon buttons with CSS −
Example
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" /> <style> button { font-family: "Lucida Sans", "Lucida Sans Regular", "Lucida Grande", "Lucida Sans Unicode", Geneva, Verdana, sans-serif; background-color: rgb(30, 173, 255); border: none; color: white; padding: 12px 16px; font-size: 32px; cursor: pointer; } i { padding: 15px; color: rgb(33, 0, 109); } button:hover { background-color: rgb(81, 44, 148); } button:hover i { color: white; } </style> </head> <body> <h1 style="font-size: 60px; font-family: Arial, Helvetica, sans-serif;"> Icon Buttons Example </h1> <button><i class="fa fa-home"></i>Home</button> <button> <i class="fa fa-phone-square" aria-hidden="true"></i>Call Us </button> <button><i class="fa fa-map-marker" aria-hidden="true"></i>Visit Us</button> <button><i class="fa fa-cog" aria-hidden="true"></i>Settings</button> <button><i class="fa fa-user-o" aria-hidden="true"></i>Login</button> </body> </html>
Output
The above code will produce the following output −
On hovering above the icon buttons −
- Related Articles
- How to create Icon Bar with CSS?
- How to create fading buttons with CSS?
- How to create loading buttons with CSS?
- How to create pill buttons with CSS?
- How to create notification buttons with CSS?
- How to create a Menu Icon with CSS?
- Create Hoverable Buttons with CSS
- How to create "next" and "previous" buttons with CSS?
- How to create custom checkboxes and radio buttons with CSS?
- How to create a fixed social media icon bar with CSS?
- How to create image overlay icon effect on hover with CSS?
- How to create Directionally Lit 3D buttons using CSS?
- How to style "alert" buttons with CSS?
- How to style outline buttons with CSS?
- How to style download buttons with CSS?

Advertisements