Change css style to first level menu
-
Hello!
Can someone help change css style for first level menu. I must change menu item called “Pakalpojumi”. Problem is that when I change style for this particular menu item, it changes items from dropdown menu aswell. But I must change only first level item name.Code which I’m using:
.item738 a span{
color:#EEE555 !important;
font-weight:bold;
text-transform:uppercase;
}Website: http://foto.alba-ltd.lv/
What I must add to that code line?
I would really appreciate some help with this.Thanks!
-
You can do this through JavaScript but in CSS, you need to override those selectors you don’t want applied by creating more CSS styles.
E.g If you don’t want the submenu styled, in general you’d add this;ul ul{ color: #000 !important; font-weight: normal text-transform: normal; }CSS-specific support can be achieved through CSS-specific forums.
Can someone look at source code in my website? There must be way how to add style only to first level menu name. I just can’t find correct style order to apply right changes.
Try using a browser developer tool for this kind of exploratory CSS work.
I use Google Chrome’s built-in Developer Tool because I find it particularly easy.Now that you know the style, from being exposed/added by the Developer Tool, you can add a new style to override it.
You ought to add new styles externally, not within the theme’s files. Changes to the theme’s files will compromise the theme and be compromised when the theme updates.
External changes can be made using a Child Theme or through a plugin that provides Custom CSS functionality.
I recommend using the Jetpack plugin and its Custom CSS functionality to hold your CSS modifications.
General CSS queries can be asked in general CSS forums such as;
http://csscreator.com/forum
http://www.cssforum.com.pk/
http://css-tricks.com/forums/
http://www.welovecss.com/
http://www.codingforums.com/
The topic ‘Change css style to first level menu’ is closed to new replies.