Results 1 to 2 of 2

Thread: Styled vertical nav bar

  1. #1
    Join Date
    Aug 2009
    Location
    London
    Posts
    93
    Thanks
    26
    Thanked 0 Times in 0 Posts

    Default Styled vertical nav bar

    Please can anyone suggest a way to get my menu to look like the jpg I have attached?
    ie I want a background colour block behind each link. The block should be a few px wider than the text and have an uneven look - not uniform.

    I know I could achieve this with just 4 regular text links, but was interested to know if it can be done in one simple, css styled list?

    Thanks, in anticipation of your response.

    Code:
    .navmenu{
    border: 0;
    background-color: 333333;
    width: 150px;
    padding-top: 15px;
    }
    
    .navmenu ul{
    padding: 0;
    margin: 0;
    list-style-type: none;
    }
    
    .navmenu a{
    font: 16px Georgia;
    text-align: left;
    padding: 4px 3px;
    display: block;
    width: 100%; /*Define width for IE6's sake*/
    color: #595959;
    text-decoration: none;
    }
    
    .navmenu a:visited{
    color: #595959;
    }
    
    .navmenu a:hover{
    background-color: #333333;
    color: #FFFFFF;
    }
    HTML Code:
    <div class="navmenu">
    <ul>
    <li><a href="#">Home</a></li>
    <li><a href="#">Collection</a></li>
    <li><a href="#">Contact</a></li>
    <li><a href="#">Online shop coming soon</a></li>
    
    </ul>
    </div>

  2. #2
    Join Date
    Jul 2010
    Location
    Denmark, Copenhagen
    Posts
    16
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    try this

    Code:
    .navmenu {
    	width: 200px;
    }
    
    .navmenu ul {
    	padding: 0;
    	margin: 0;
    	list-style-type: none;
    }
    
    .navmenu li {
    	margin-top: 10px;
    }
    
    .navmenu .top {
    	margin: 0;
    }
    
    .navmenu a {
    	background: #FFFFFF;
    	padding: 4px;
    	display: inline;
    	color: #595959;
    	text-decoration: none;
    }
    
    .navmenu a:visited {
    	color: #595959;
    }
    
    .navmenu a:hover {
    	background-color: #333333;
    	color: #FFFFFF;
    }
    Code:
    <div class="navmenu">
    <ul>
    <li class="top"><a href="#">Home</a></li>
    <li><a href="#">Collection</a></li>
    <li><a href="#">Contact</a></li>
    <li><a href="#">Online shop coming soon</a></li>
    </ul>
    </div>

  3. The Following User Says Thank You to tomywie For This Useful Post:

    jhatter (07-08-2010)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •