Different colored stylish variable width menus with text-transition using CSS

Updated on September 1, 2017

Webmaster should always think of simple, attractive and fast loading menus, due to which the visitor experience on the website increases and makes him to comeback again. This increases your returning visitors and in-turn popularity. Here i will be showing you a very simple and attractive menu, which is a stylish, different colored and with a text transition too all by using CSS only.

Different colored menu
Different colored menu

[sc:demobuttons demolink=”http://demo.techglimpse.com/stylish-menu/” boxlink=”http://adf.ly/Pkrdf”]

Requirement : Similar icons based on your menu item needs to be prepared and the color background of each menu item to be noted.

Step 1 : In the head section of your html template, include the below CSS Code.

<style type="text/css">
.rss-menu { 
 position: relative;
 list-style-type: none;
 max-width: 150px;
 margin-left: -10px;
.rss-menu a {
 color: #fff;
 -webkit-transition:padding-left 250ms ease-out;
 -moz-transition:padding-left 250ms ease-out;
.rss { 
 display: block;
 line-height: 1.8em;
 text-align: left;
 position: relative;
 padding-left: 25px;
 -webkit-transition: padding-left 250ms ease-out;
 font-weight: bold;
.color1 {
 background:rgb(0, 128, 216) url("home.png") 4px 8px no-repeat;
 background-size:14px 16px;
.color2 {
 background: rgb(197, 0, 0) url("apple-logo.png") 4px 8px no-repeat;
 background-size:14px 16px;
.color3 {
 background:#2b9d22 url("car-logo.png") 4px 10px no-repeat;
 background-size:15px 13px;
.color4 {
 background:rgb(202, 121, 0) url("windows-logo.png") 4px 10px no-repeat;
 background-size:16px 14px;
.color5 {
 background:rgb(223, 30, 122) url("information.png") 8px 10px no-repeat;
 background-size:8px 16px;
.rss-menu li:hover a {
 padding-left: 8px;

Here we split the styles into two. One is the common styles applicable to all the li’s and the second one is varying color’s and width based on the individual li’s. Here my common styles named as rss and varying individual li’s will have styles like color1, color2 etc., which has styles of varying width, background color and corresponding icon. For the text transition, on li-hover apply a padding-left. To make the transition smooth, the common li styles should have the styles

-webkit-transition: padding-left 250ms ease-out;

Step 2 : Include the below “ul-li” based menu in the body section of your HTML template.

<ul class="rss-menu">
<li class="rss color1"><a  href="#">Home </a></li>
<li class="rss color2"><a  href="#"></a>JailBreaks</li>
<li class="rss color3"><a  href="#"></a>Auto</li>
<li class="rss color4"><a  href="#"></a>Windows 8</li>
<li class="rss color5"><a  href="#"></a>Around Web</li>

Now see your menus loading faster and looking great too.

[sc:demobuttons demolink=”http://demo.techglimpse.com/stylish-menu/” boxlink=”http://adf.ly/Pkrdf”]

Was this article helpful?

Related Articles

Leave a Comment