Jump to content

How to Target multiple data-section-id

Recommended Posts

I have this code

section[data-section-id="6227c317dd10fe3ede293536"] h4 {
  background-color: #512d4f;
  padding: 10px;
}

But i have multiple sections where I want to apply this code. Instead of repeating the code 

section[data-section-id="6227c317dd10fe3ede293536"] h4 {
  background-color: #512d4f;
  padding: 10px;
}

section[data-section-id="6227e125a2838046a12e5f32"] h4 {
  background-color: #512d4f;
  padding: 10px;
}

 

How can I shorten this? 

Also, if you can point me to a resources to lear that kind of thing that would be helpful. 

Thanks

 

Link to comment
6 hours ago, chrisshaddock said:

I have this code

section[data-section-id="6227c317dd10fe3ede293536"] h4 {
  background-color: #512d4f;
  padding: 10px;
}

But i have multiple sections where I want to apply this code. Instead of repeating the code 

section[data-section-id="6227c317dd10fe3ede293536"] h4 {
  background-color: #512d4f;
  padding: 10px;
}

section[data-section-id="6227e125a2838046a12e5f32"] h4 {
  background-color: #512d4f;
  padding: 10px;
}

 

How can I shorten this? 

Also, if you can point me to a resources to lear that kind of thing that would be helpful. 

Thanks

 

Hi, you can use commas to select multiple sections. The code will look like this:

section[data-section-id="6227c317dd10fe3ede293536"] h4, section[data-section-id="6227e125a2838046a12e5f32"] h4 {
  background-color: #512d4f;
  padding: 10px;
}

 

Please give this a 👍 if it helps. Make sure to quote me or tag me in your reply, otherwise I won't be notified.

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.