Jump to content

Horizontally Center Image in Responsive Design

Recommended Posts

Site URL: https://tulip-violin-g9e5.squarespace.com/core-values

Hello,

I'm trying to align an image horizontally. It looks great until the webpage resizes to fit various screen sizes. I'd like to center it in relation to the text on the left, but haven't been able to figure out the right code. See attached screenshots for reference. I've tried everything and can't get it -- help would be SO appreciated!

Screen Shot 2020-02-25 at 2.05.38 PM.png

Screen Shot 2020-02-25 at 2.05.27 PM.png

Link to comment
  • Replies 8
  • Views 1.4k
  • Created
  • Last Reply
21 hours ago, kaitlinrayelle said:

Add to Home > Design > Custom CSS

@media screen and (min-width:641px) {
div#page-5e544a9d734d5849d0c1899b>.row {
    display: flex;
    justify-content: center;
    align-items: 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
  • 3 weeks later...
1 hour ago, kaitlinrayelle said:

Finally figured it out! you need to use the row id! here's a sample:

#yui_3_17_2_1_1584842933157_421 {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

 

Your code won't work, try F5 ;) 

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
17 hours ago, tuanphan said:

I see the code worked here?image.thumb.png.0de5a64c8016cf26f305e2e9efdbd5fc.png


@media screen and (min-width:641px) {
div#page-5e544a9d734d5849d0c1899b>.row {
    display: flex;
    justify-content: center;
    align-items: center;
}
}

 

Just when I thought we had it...

no, that's not working? it looks good on a desktop but when resized to the ipad it's not centered

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • 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.