
- 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 Bar with CSS?
To create Icon Bar with CSS, the code is as follows −
Example
<!DOCTYPE html> <html> <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> .icon-bar { width: 100%; background-color: black; overflow: auto; } .icon-bar a { float: left; width: 30%; text-align: center; color: white; font-size: 30px; } .active { background-color: blue; } </style> <body> <div class="icon-bar"> <a href="#"><i class="fa fa-home"></i></a> <a href="#"><i class="fa fa-search"></i></a> <a class="active" href="#"><i class="fa fa-bars"></i></a> </div> </body> </html>
Output
This will produce the following output −
Example
Let us now see another example wherein we will create vertical icon bar −
<!DOCTYPE html> <html> <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> .icon-bar { width: 50px; background-color: black; } .icon-bar a { display: block; text-align: center; color: white; font-size: 30px; } .active { background-color: blue; } </style> <body> <div class="icon-bar"> <a class="active" href="#"><i class="fa fa-home"></i></a> <a href="#"><i class="fa fa-search"></i></a> <a href="#"><i class="fa fa-bars"></i></a> </div> </body> </html>
Output
This will produce the following output −
- Related Articles
- How to create a fixed social media icon bar with CSS?
- How to create icon buttons with CSS?
- How to create a Menu Icon with CSS?
- How to create a skill bar with CSS?
- How to create image overlay icon effect on hover with CSS?
- How to create a dropdown navigation bar with CSS?
- How to create a responsive navigation bar with dropdown in CSS?
- How to Create an On Scroll Fixed Navigation Bar with CSS?
- Create a Horizontal Navigation Bar with CSS
- How to create a navigation bar with a centred link/logo with CSS?
- How to create a navigation bar with equal-width navigation links with CSS?
- How to create an Android notification without the icon in the status bar?
- How to create a navigation bar with left-aligned and right-aligned links with CSS?
- How to create a JLabel with an image icon in Java?
- How to remove the icon from the title bar in Tkinter?

Advertisements