• Resolved jdiomede

    (@jdiomede)


    I’m currently using class=”alignleft …” for an image on a page and that image is placed 90px beyond the text justification (for web and tablet, where the screen width is not limited). what would be the appropriate way in the Cubic theme to make sure the text and image are aligned to the same boundary?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Sarah Blackstock

    (@sarahblackstock)

    Hi there! Can you share a link to your site so we can check it out? A link/details to find the exact image you mean would be great too! ??

    Thread Starter jdiomede

    (@jdiomede)

    Hello, sure you can see an example of this problem here: themusicologygroup.com/vintage-guitar/

    Sarah Blackstock

    (@sarahblackstock)

    Thanks for the link!

    The image alignment is displaying as expected due to how the theme is made. You can see examples of the different alignment settings here so you’ll know what to expect for different ones: https://cubicdemo.wordpress.com/image-alignment-and-styles/.

    However, if you’d like to change that, you can use custom CSS to do so. Make sure you make any CSS adjustments in a CSS editor, rather than directly into your theme, to avoid losing your changes each time you update your theme. Since you’re using the Jetpack plugin, you could activate the Custom CSS module in the plugin and use that to add your CSS, if you’d like.

    I played around with the CSS a bit (and tried to make sure it didn’t make things align oddly on smaller screens), so give this a try and see what you think:

    @media screen and (min-width: 700px) {
    img.alignleft {
    	padding-left: 70px;
    	margin-right: 10px;
    	margin-bottom: 0px;
    }
    }

    If you’re using Jetpack’s CSS module, after it’s activated, you’ll go to Appearance > Edit CSS and paste the code in there, then save.

    The 70px will shift the image to the left and 70 looks correct on my end (but you can change it to whatever works for you).

    The other two numbers will adjust the spacing to the right and below your image in relation to the text wrapping around it. When I changed the padding on my test site, the gaps there were too large, so I added that too in case the same thing happens on your end.

    Hope that helps! Let me know if you have any questions.

    Thread Starter jdiomede

    (@jdiomede)

    Thanks, that worked however I ended up adding a constraint on the image width as well since after the padding adjustment the overall image size was decreased.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘left align different for images and text justification’ is closed to new replies.