Jump to content

Change focal point for an image with css

Recommended Posts

Hello, I'm trying to change the focal point to center for an image inside an accordion. I can't share the site because is hidden. However, this is the code I'm using: 

li:nth-child(1) .accordion-item__description:before {
  
  content:" ";
display:block;
    
    background-image: url(https://static1.squarespace.com/static/6505228afdd85426284bf7ad/t/66728fe4f00cd419ec25abec/1718783992276/dji_fly_20231105_121652_0012_1699166046586_photo+2+copia.jpg) ;
 
  background-size:cover;
background-repeat:no-repeat;
  border-radius: 15px;
margin-right:20px;
width: 200%;
  height:130px;
  
}

 

I attach the image of how it looks now.

I really need help!!!!!


  

Screenshot 2024-07-05 alle 11.19.07.png

Link to comment
  • Replies 1
  • Views 858
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

You can use attribute: background-position

for example

li:nth-child(1) .accordion-item__description:before {
  
  content:" ";
display:block;
    
    background-image: url(https://static1.squarespace.com/static/6505228afdd85426284bf7ad/t/66728fe4f00cd419ec25abec/1718783992276/dji_fly_20231105_121652_0012_1699166046586_photo+2+copia.jpg) ;
 
  background-size:cover;
background-repeat:no-repeat;
  border-radius: 15px;
margin-right:20px;
width: 200%;
  height:130px;
  background-position: left center;
}

 

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.