Archived topic
How to put a Gradiant as Menue Background?
4 replies · Started by Marc Volle on December 22, 2014
Hi there,
im trying to get a Color gradiant as the Background Color in my main menue. Since this isnt in the Options of the theme (yet? ;) ) i tryed to add it via CSS (Simple CSS Plugin) but i cant get it to work, it seems like the theme keeps overwriting the Gradient CSS. Maybe somebody has an idea how to get this to work? :/
Thanks in Advance
I can tell you how I would do it.
I like the plugin Simple Custom CSS for adding my CSS.
I like Ultimate CSS Gradient Generator by Colorzilla for working out gradients.
In the CSS, I would add
.inside-navigation {
/*code from colorzilla*/
background: #1e5799; /* Old browsers */
background: -moz-linear-gradient(top, #1e5799 0%, #2989d8 50%, #dee2e5 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#1e5799), color-stop(50%,#2989d8), color-stop(100%,#dee2e5)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #1e5799 0%,#2989d8 50%,#dee2e5 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #1e5799 0%,#2989d8 50%,#dee2e5 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #1e5799 0%,#2989d8 50%,#dee2e5 100%); /* IE10+ */
background: linear-gradient(to bottom, #1e5799 0%,#2989d8 50%,#dee2e5 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1e5799', endColorstr='#dee2e5',GradientType=0 ); /* IE6-9 */
}
The above should work (thanks, Dee!) as long as your navigation doesn't have a background color set, as well as your menu items.
You can also create a gradient image which can be however tall your navigation is, and about 5px wide. Then set it as the background image and repeat-x.
Thanks, this helped me out alot. How would you add a color gradiant to Mouse Over in the menu? With :hover?
Yes, you would use .main-navigation li a:hover :)