Jump to content

[Share] Blog page custom aspect ratio

Recommended Posts

Posted

These CSS code will help you change aspect ratio on specific blog page, specific blog post...

#1. Specific Blog Page

First, find Blog Page ID.

In my example, it is: #collection-6677756d03a4f15ba27ce9d8

image.png.83479a48ebe3a983ca5b0dd7e93d3eee.png

Next, use this CSS code

#collection-6677756d03a4f15ba27ce9d8 article.blog-item .image-wrapper {
    padding-bottom: 75% !important;
}

image.png.8aae91300681591997905cb2c4825d2b.png

#2. Specific Blog Page (Desktop Only)
If you want the code affects Desktop Only, you can use this CSS code

@media screen and (min-width:768px) {
  #collection-6677756d03a4f15ba27ce9d8 article.blog-item .image-wrapper {
      padding-bottom: 75% !important;
  } 
}

image.png.144b4a44166e953de0c1c3f7f8a223d6.png

#3. Specific Blog Page (Mobile Only)
If you want the code affects Mobile only, use this CSS code

@media screen and (max-width:767px) {
  #collection-6677756d03a4f15ba27ce9d8 article.blog-item .image-wrapper {
      padding-bottom: 75% !important;
  } 
}

image.png.9a94e4cf1a8622ab9db0bf96c84d7e5d.png

#4. Specific Blog Item
First, you need to find blog item url.
In my example, it is: /blog-2-1/the-mountai-bike

image.png.494768396e35d9861fbdeb56d800fcca.png

Next, use this CSS code

article.blog-item .image-wrapper[href="/blog-2-1/the-mountai-bike"] {
    padding-bottom: 120% !important;
}

image.png.5b7e65f703c291e91b1a854688bfaf2e.png

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

  • Replies 0
  • Views 44
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

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.