show-notice
hide-notice

Thursday, 4 July 2013

Vertical CSS3 Shadow Menu





Introduction: 

This CSS Menu uses CSS3's ability to define multiple/ inset shadows (so the shadow grows inwards) on an element to create menu items with a bevelled left edge and a growing inner glow when the mouse rolls over them. CSS3 animation is enabled to gradually transition between various property changes. When the mouse rolls over a menu item, 3 inner shadows of the same color but varying strengths and opacity are applied to it:





<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



<html xmlns="http://www.w3.org/1999/xhtml">

<head>

    <title>Untitled Page</title>

    <style>

        .shadowblockmenu-v

        {

            font: bold 14px Germand;

            width: 190px; /* width of menu */

        }

        .shadowblockmenu-v ul

        {

            border: 1px solid #eee;

            padding: 0;

            margin: 0;

            list-style: none;

        }

        .shadowblockmenu-v ul li

        {

            margin: 0;

            padding: 0;

        }

        .shadowblockmenu-v ul li a

        {

            display: block;

            text-transform: uppercase;

            color: #494949;

            padding: 10px 15px;

            text-decoration: none;

            border-bottom: 1px solid #cacaca;

            border-right: 1px solid #cacaca; /*right border between menu items*/

            -moz-box-shadow: inset 7px 0 10px rgba(114,114,114, 0.6); /* Add inset shadow to each menu item. First 3 values in (114,114,114, 0.5) specifies rgb values, last specifies opacity */

            -webkit-box-shadow: inset 7px 0 10px rgba(114,114,114, 0.6);

            box-shadow: inset 7px 0 10px rgba(114,114,114, 0.6);

            text-shadow: 0 -1px 1px #cfcfcf; /* CSS text shadow to give text some depth */

            -moz-transition: all 0.2s ease-in-out; /* Enable CSS transition between property changes */

            -webkit-transition: all 0.2s ease-in-out;

            -o-transition: all 0.2s ease-in-out;

            -ms-transition: all 0.2s ease-in-out;

            transition: all 0.2s ease-in-out;

        }

        .shadowblockmenu-v ul li a:hover, .shadowblockmenu-v ul li a.selected

        {

            color: black;

            -moz-box-shadow: inset 7px 0 10px rgba(216,89,39, 0.5), inset 0 0 15px rgba(216,89,39, 0.6), inset 0 0 20px rgba(216,89,39, 0.8); /* Add 3 inset shadows to each menu item  */

            -webkit-box-shadow: inset 7px 0 10px rgba(216,89,39, 0.5), inset 0 0 15px rgba(216,89,39, 0.6), inset 0 0 20px rgba(216,89,39, 0.8);

            box-shadow: inset 7px 0 10px rgba(216,89,39, 0.5), inset 0 0 15px rgba(216,89,39, 0.6), inset 0 0 20px rgba(216,89,39, 0.8);

        }

    </style>

</head>

<body>

    <div class="shadowblockmenu-v">

        <ul>

            <li><a href="your link">Dynamic Drive</a></li>

            <li><a href="your link">CSS Library</a></li>

            <li><a href="your link">CSS Drive</a></li>

            <li><a href="your link">Gif Optimizer</a></li>

            <li><a href="your link">Favicon Creator</a></li>

            <li><a href="your link">Button Maker</a></li>

        </ul>

    </div>

</body>

</html>






SHARE THIS POST   

0 comments :

Post a Comment

Design by Gohilinfotech | www.gohilinfotech.blogspot.com