Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Customizing a Superfish menu mostly involves writing your own CSS to style the menu the way you'd like. Here's how we'll create a custom look for the menu:
If you'll remember some web basics, you'll remember that CSS stands for Cascading Style Sheets. The cascading features are what we'll focus on here. Any styles we write for the top level of our menu are going to cascade down to the other levels of the menu. We have to remember that and handle all the cases where we'd rather stop a style from cascading downward.
styles.css file:/**** Level 1 ****/
.sf-menu,
.sf-menu * {
list-style: none;
margin: 0;
padding: 0;
}
.sf-menu {
background: #f6f6f6; /* Old browsers */
background: -moz-linear-gradient(top, rgba(0,0,0,1) 1%, rgba(56,56,56,1) 16%, rgba(255,255,255,1) 17%, rgba(246,246,246,1) 47%, rgba(237,237,237,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,rgba(0,0,0,1)), color-stop(16%,rgba(56,56,56,1)), color-stop(17%,rgba(255,255,255,1)), color-stop(47%,rgba(246,246,246,1)), color-stop(100%,rgba(237,237,237,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(0,0,0,1) 1%,rgba(56,56,56,1) 16%,rgba(255,255,255,1) 17%,rgba(246,246,246,1) 47%,rgba(237,237,237,1) 100%); /* Chrome10+,Safari5.1+ */
back....
Phew! That seems like a lot of code, but much of it is the repeated gradient and shadow declarations we have to use for each different type of browser. Keep your fingers crossed that this requirement goes away soon and the browser vendors eventually reach agreement on how gradients and drop shadows should be created with CSS.