Advanced Search Usage Terms Submit Contact
Dynamic Drive CSS Library
 
CSS Library
Submit an original CSS code
CSS Layouts
Web Graphics
Online Tools:

Advertise Here

CSS Library: Horizontal CSS Menus: Here

Solid Block Menu

Author: Dynamic Drive

This is a lean, professional looking CSS menu that's draped in a solid two color background image. The divider between the menu items is simply a white CSS border. The style is extremely easy to customize thanks to the simple background image used.

Demo:


The two images used (resized horizontally):

The CSS:

The HTML:

Code Info

Rate this code:

Date Posted: 03/27/2007

Revision History: July 6th 08"- Updated CSS for improved clear float in IE.

Usage Terms: Click here

Your Comments (150)

Got a question or need help customizing this CSS code? Post it in the CSS Forums. If you have a comment or suggestion instead, post it in the comments section below.

Comment Pages 15 of 15 pages « First  <  13 14 15

Worked code!

<style type="text/css">

/*Credits: Dynamic Drive CSS Library */
/*URL: http://www.dynamicdrive.com/style/ */

.solidblockmenu li{
display: inline;
}

.solidblockmenu li a{
float: left;
color: white;
padding: 9px 11px;
text-decoration: none;
border-right: 1px solid white;
}

.solidblockmenu li a:visited{
color: white;
}

.solidblockmenu li a:hover, .solidblockmenu li .current{
color: white;
background: transparent url(http://www.dynamicdrive.com/cssexamples/media/blockactive.gif) center center repeat-x;
}

.solidblockmenu{
margin: 0;
padding: 0;
float: left;
font: bold 13px Arial;
width: 100%;
border: 1px solid #625e00;
border-width: 1px 0;
background: black url(http://www.dynamicdrive.com/cssexamples/media/blockdefault.gif) center center repeat-x;
list-style: none;
}

</style>

<!--[if IE]>
<style type="text/css">
p.iepara{ /*Conditional CSS- For IE (inc IE7), create 1em spacing between menu and paragraph that follows*/
padding-top: 1em;
}
</style>
<![endif]-->
Posted by Nikijs on 09/10, 06:10 AM
I have some rather long tab names ie. "Reference Books & Dictionaries. How can I get them to display on two lines on a single tab and keep the single line names like "Software" centered vertically?

Our current tab menu is .js and we want to move to CSS. Our horizontal top menu.

http://www.transcriptiongear.com
Posted by Hugh Via on 09/11, 11:28 AM
The code is almost working..

My second "link-block" is always red..
I think it sees that block as the active block..
How do I fix this?
Posted by Ultimate-Tester on 09/13, 04:13 AM
is there a dropp down verison of this one?
Posted by selim31 on 10/03, 07:22 PM
After tinkering with several CSS classes I finally figured out how to center the buttons....remove margin-bottom: 1em; from .solidblockmenu /// replace it with margin: 0em; instead /// the borders were also removed for a smooth Web 2.0 look too...may not be syntax but it works (Note - image names were changed & code was organized)

.solidblockmenu
{
background: #000000 url(images/apps/top_menu1.gif) center center repeat-x;
border: 1px solid #595959;
border-width: 1px 1px;
float: left;
font: bold 12px arial, tahoma, verdana, helvetica, sans-serif, serif;
margin: 0em;
overflow: hidden;
padding: 0px;
width: 100%;

}

.solidblockmenu li
{
display: inline;
}

.solidblockmenu li a
{
border-center: 1px solid #FFFFFF;
color: #FFFFFF;
float: left;
margin: 1px;
padding: 7px 10px;
text-align: center;
text-decoration: none;

}

.solidblockmenu li a:hover, .solidblockmenu li .current
{
background: transparent url(images/apps/top_menu2.gif) center center repeat-x;
color: #FFFFFF;
}

.solidblockmenu li a:visited
{
color: #FFFFFF;
}
Posted by FlexCoder on 10/12, 04:35 AM
Ya same question how do you center the menu in an image or table?
Posted by Victor on 10/30, 01:04 PM
Has anyone had any problems getting this to work in Firefox on a Mac?
Posted by Mark on 11/06, 05:25 AM
Hi

Do you know maby how i can one of li list in this menu create in fiferent colour?

i would like forexample that gallery meny was green always.

sorry my english is not very well
Posted by Paweł on 11/27, 06:36 PM
i am trying 2 use this css menu code.... but it doesn't align properly .. i am trying to make it to fit the table height but it doesn't work
Posted by James Mark on 12/07, 11:25 PM
nice menu. but i need it to support dropdown menu as well using css. please tell me simplest css tweak to make it work with submenus. no css experience
Posted by kamirao on 01/04, 09:56 AM

Comment Pages 15 of 15 pages « First  <  13 14 15

Name: (Required)

Email: (Required)

(NOT shown on page)

URL:

(Shown on page if entered)

Comments: (Required)

Supported BB codes: [b], [i], [u], [em], [strike], [strong], [pre], [code], and [blockquote].

Remember my personal information
Notify me of follow-up comments?

Submit the word you see below ("previewing" post does not require it):


Copyright 2006-2008 Dynamic Drive Read our Usage Terms before using any of the CSS codes.
Dynamic Drive DHTML and CSS Code Library