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

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) {

}

 

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
On 3/16/2022 at 2:58 PM, MJohn said:

The other first sections should look like this (image attached). The wavy line should be closer to the top text.1008025313_Screenshot2022-03-16at3_57_27PM.png.306da2b0da43f1d0b0dd54b023f6a9fe.png

Can you share link to page in screenshot?

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

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.