• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

:first-of-type / :last-of-type – not isolating individual element

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › StudioPress Themes › Genesis Sample › :first-of-type / :last-of-type – not isolating individual element

This topic is: not resolved

Tagged: first-child, first-of-type, nth-child(1)

  • This topic has 2 replies, 2 voices, and was last updated 3 weeks, 1 day ago by Toby39.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • January 13, 2023 at 8:50 am #506567
    Toby39
    Participant

    Hi guys,
    I am an old Studiopress customer and I have a question about modifying the Genesis-Sample theme. I have already tried to modify the CSS in what I thought was the correct way, but it doesn't seem to work, so I though this might be something unique to Genesis.

    I am trying to modify the ".nav-primary .genesis-nav-menu a {" to add an exception for the FIRST menu item, like so ".nav-primary .genesis-nav-menu a:first-of-type {"

    .nav-primary .genesis-nav-menu a {
    margin-left: 30px;
    }
    .nav-primary .genesis-nav-menu a:first-of-type {
    margin-left: 0px;
    }

    However, I notice that whatever I set for ":first-of-type" ends up applying to ALL the menu items, not just the first.

    I have tried to apply this method to various other selectors, all to no avail.

    Any help would be much appreciated. Thank you

    _ _ _ _ _ _ _ _ _

    URL: https://www.businesslabs.uk/wp-login.php
    Username: studiopress
    Password: KWcXBTQB&Tm*dNxc%G0iKD1v

    https://www.businesslabs.uk/wp-login.php
    January 13, 2023 at 9:50 am #506571
    Brad Dalton
    Participant

    Here's 3 ways to use pseudo-classes to style the 1st nav menu item in Genesis child themes.


    Get Help – Book Consultation.

    January 13, 2023 at 10:27 am #506573
    Toby39
    Participant

    Hey, thanks Brad.

    .nav-primary .genesis-nav-menu > li:first-of-type ... worked a charm.

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Log In

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble