Jump to content

make resized images for mobile justify left or right

Go to solution Solved by Ziggy,

Recommended Posts

i used this code to make specific images smaller on mobile:

 

Quote
/* CSS FOR TABLET AND MOBILE */
@mobile: ~"only screen and (max-width: 640px)";
@tablet: ~"only screen and (min-width: 641px) and (max-width: 949px)";

/* CSS FOR TABLET */
@media @tablet {
/* Insert Code for Tablet Below This Line*/

/* Insert Code for Tablet Above This Line */
}

/* CSS FOR MOBILE */
@media @mobile {
/* Insert Code for Mobile Below This Line*/
  
#blockidnumber { 
  width: 80% !important;
  margin: 0 auto;
}
/* Insert Code for Mobile Above This Line */
}

 

this works to make the images smaller, but they show up centered. can someone tell me how to left justify or right justify the images?

website www.be-with.org

thank you!

Link to comment
  • Solution

You'll need to adjust the margin, change to this:

margin: 0 auto 0 auto;

What this means is values of:

margin: (top) (left) (bottom) (right);

What this means for you is that if you want to align an image to the left, change the left value to 0

margin: 0 0 0 auto;

of if you want to align the image right:

margin: 0 auto 0 0;

You will need to have a different section in the CSS for images that are centered, left aligned, and right aligned.

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 

  Did I help? Buy me a coffee?

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 

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.