kessi-cpa Library logo (4.0 KB)

How to Make Menu Bar with Icons and Text


Adding icons to a menu bar facilitates navigation and improves users' browsing experience.

There are many web icons you can use for free. In this example, we used icons from by Dave Gandy.

Note: for the download icon in the button example to properly display, you have to insert the following link in the head section of your page ("Font Awesome by Dave Gandy -
<link rel="stylesheet" href=""/>


How To

1. Add HTML

<link rel="stylesheet" href=""/>

<div class="menuBar">
    <a href="#" class="menuBarButton" onclick="show_page('Home Page')">
        <span><i class="fa fa-home"></i></span>
    <a href="#" class="menuBarButton" onclick="show_page('Products Page')">
        <span><i class="fa fa-product-hunt"></i></span>
    <a href="#" class="menuBarButton" onclick="show_page('About Page')">
        <span><i class="fa fa-info-circle"></i></span>
    <a href="#" class="menuBarButton" onclick="show_page('Contact Page')">
        <span><i class="fa fa-envelope"></i></span>
<div class="dvPage">
    <label id="lblPage">Home Page</label>

2. Add CSS

    width: 100%;
    height: auto;
    background-color: #ccc;

    height: 60px;
    width: 100px;
    margin: 5px 0;
    display: table-cell;
    text-align: center;
    vertical-align: middle;
    color: #666;
    cursor: pointer;
    font-size: 18px;
    text-decoration: none;
    transition: 0.4s;

    background-color: #666;
    color: #fff;

.menuBarButton span
      display: block;

.menuBarButton i
    font-size: 25px;

    height: 200px;
    width: 100%;
    padding: 15px;
    font-size: 20px;
    border: 1px solid #ccc;
    margin-top: 15px;

3. Add JavaScript

<script type="text/javascript">
    function show_page(pg) {
        try {
            document.getElementById("lblPage").innerText = pg;
        catch (err) {
js for dialogbox (39 kb)
Author of this article:
Mahmoud Kessi, CPA, CGA
(204) 226-9576

Comments & Questions

Add New Comment or Question



Email Link

Link to be shared:



Copyright © 2016-2019 KESSITEK.