Jump to content

How to use section:nth-child(1) but have it not apply to blog pages in 7.1

Recommended Posts

Site URL: https://brambledesign.squarespace.com/

Hi everyone,

This is what I've tried but it hasn't worked. 

section:nth-child(1):not(.blog-item-content)

Basically I want some CSS to apply to all other 1st sections except for the individual blog post pages.

pw: hello

Thanks in advance!

👋 Michelle John
💕 
Catchafire volunteer 
🖥️ Web & graphic design for churches, nonprofits & small businesses

🔗 brambledesign.co

Bramble Design

Link to comment
16 minutes ago, tuanphan said:

Body tag on blog page will have different class name compared other pages, so I usually exclude blog page class name with body

body:not([class*="collection-type-blog"]) section:nth-child(1) {

}

 

I just applied that code but it stopped working on the other 1st sections.

  body:not([class*="collection-type-blog"]) section:nth-child(1) {
    p {
    margin-top: 2em !important;
    margin-bottom: -1.5em !important;
    }
    h1,h2 {
      margin-bottom: 1.5em !important;
    }
}

 

👋 Michelle John
💕 
Catchafire volunteer 
🖥️ Web & graphic design for churches, nonprofits & small businesses

🔗 brambledesign.co

Bramble Design

Link to comment
4 hours ago, MJohn said:

I just applied that code but it stopped working on the other 1st sections.

  body:not([class*="collection-type-blog"]) section:nth-child(1) {
    p {
    margin-top: 2em !important;
    margin-bottom: -1.5em !important;
    }
    h1,h2 {
      margin-bottom: 1.5em !important;
    }
}

 

Just checked & I see the code worked here.

Try reloading your site & check again

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.