It does this because you’ve told it to. li.active a
means “all a
tags that are descendants of li
tags with the active
class”, and submenus in WordPress are structured like this:
<ul>
<li>
<a href="#"></a>
<ul>
<li>
<a href="#"></a>
</li>
</ul>
</li>
</ul>
So the li
for any menu item with a submenu also contains all the a
tags for links in those submenus.
To only the first link inside a menu item you need to use the child selector:
.header ul li.active > a {}
Related Posts:
- Making a
- How to change the color of an svg element?
- How to implement max-font-size?
- @Media min-width & max-width
- How do I center this form in css?
- How can I replace text with CSS?
- Bootstrap 4, How do I center-align a button?
- How do I horizontally center a span element inside a div
- What does an asterisk (*) do in a CSS selector?
- height style property doesn’t work in div elements
- Text not wrapping inside a div element
- How to make padding:auto work in CSS?
- combined multiple classes into one css rule
- CSS Outside Border
- CSS not working in Chrome
- Rainbow gradient on text in CSS
- CSS3 opacity gradient?
- use multiple css filters at the same time?
- What would be the best method to code heading/title for ul or ol, Like we have caption in table?
- How can I make my header image properly responsive?
- CSS fixed width in a span
- Adding border to CSS triangle [duplicate]
- How to enqueue style before style.css
- Remove wp_add_inline_style
- WordPress Register Style Called Incorrectly
- wp_enqueue_script + how to load JS or CSS in one URL merge call?
- Duplicate and alter sidebar for Twenty Eleven
- How to dequeue styles coming from plugins?
- How to set different font family based on text language?
- How to exclude certain code from style.css? [closed]
- Need Help Figuring Out Admin Menu Hover Styling Class
- How to decrease picture size
- whats happening with my index page?
- How do I add an indicator to my .menu-item if it contains a .sub-menu?
- How do you customize the admin bar for buddypress?
- Change via CSS the color of social menu icons
- Header’s CSS doesn’t work in Chrome and Opera – any ideas how to fix it?
- @media in bluehost is being commented out [closed]
- Twenty Fifteen : Wider right column for the content
- Moving button on Online Consulting theme
- css file status 403
- How can I get the search form to be selected automatically?
- Adding Custom css file
- Using transient for dynamic css , how to name it?
- Is there a way to add additional CSS styles to the styles css file dynamically?
- Is it safe to use WordPress generated classes?
- styling wp_nav_menu – horizontal, sub-menu drop downs
- Change CSS on a wordpress post
- Unstable handling of CSS under WordPress/Elementor
- Trying to hide a button on a specific WordPress Page ID
- How to add animation the featured image?
- get_template_directory_uri() generates wrong path
- How to change the settings of a video? [closed]
- Change text color dynamically in WordPress [closed]
- First element/selector of enqueued CSS file breaks
- Different background for different page
- calling an additional css and js links for a custom page template
- Is there any way to change the CSS class applied to 2nd level sub menu ul’s?
- Styling last item in ul [closed]
- How to change color of some items through css [closed]
- Remove custom css made by the custom theme
- Font styling in embedded Twitter feed
- WordPress backend is loading as a list
- Is there any way we can restore the “Additional CSS” after being erased?
- sidebar with hovering mouse effect
- Default paragraph block styles just for pages NOT for posts?
- Embed widget from external source (Zendesk)
- Loading a stylesheet conditionally & verifying CSS
- Dequeue styles with query doesn’t work
- Dynamically populated scss values or how to change styles by user choice
- Save custom option in CSS file
- WordPress login using a completely custom page and no plugins?
- Modifications on css file are not visible
- Gutenberg CSS Issue
- When changing theme’s font, why does font-size attribute not work? [duplicate]
- Hide BBPress create topic on one page
- Dropdown contents hidden behind content [closed]
- About copy and paste content and formatting
- How to display a background image in a page body area? [closed]
- Menu reduce space between words
- add css to only body text
- Improving the readibility of bright text on a bright background [closed]
- Vertical aligning CSS pushes column to left [closed]
- Specific text not affected by CSS style [closed]
- Import HTML code that loads css and javascript into specific page
- checkbox function not working for dropdown menu
- How to change hover color on bulk-action-selector-top and bottom on wordpress admin?
- Exclude parts of default css import
- Replacing parent theme’s IE-specific CSS
- modify stylesheet of a particular page inside wp-admin
- Having Trouble Styling a Table in a WordPress Post
- Bootstrap 4 Optimization
- How to change wordpress registration form submit button value?
- Move main menu to top of screen
- Can’t override CSS with child theme
- Custom css code in wordpress [closed]
- Using Easy Google Fonts correctly and Droid Sans on Max OS X [closed]
- remove white overlay [closed]
- Why doesn’t media(max-width) work on h2 title?
- How to use WordPress 3.8 back-end CSS in front-end?