Jump to content

Centering Content of Code Block

Recommended Posts

Site URL: https://www.travelsandtreasures.com

I've searched the forum and have been playing with this for hours.  Any suggestions on how to center the content of a code block (it's on my home page).  

 

I've tried

  • adding align="center" to the DIV tag
  • adding class="center" to the IMG tag with 

.center {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: 50%;

}

 

Nothing works.  I'm stumped. 

BDC Centering.JPG

Link to comment
55 minutes ago, jsanzloz said:

Hiya 👋

Try replacing those CSS lines with these ones:

display:flex;

justify-content: center;

Hi there, 

I tried both in the DIV tag, IMG tag, and SCRIPT tag ....didn't work and I'm not sure that I really know what I'm doing 🤪😂

Link to comment
On 6/9/2021 at 1:50 AM, TTaylor said:

Hi there, 

I tried both in the DIV tag, IMG tag, and SCRIPT tag ....didn't work and I'm not sure that I really know what I'm doing 🤪😂

Can you share link to page where you added Code Block? Wee don't see it on homepage

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
  • 10 months later...
57 minutes ago, kdear said:

I've been having a similar issue with code blocks in the footer.  They don't center align.

Your issue appears to be related to the summary block near the end of the page causing an overflow condition.

I don't have an solution at this time but perhaps others do.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
18 minutes ago, creedon said:

Your issue appears to be related to the summary block near the end of the page causing an overflow condition.

I don't have an solution at this time but perhaps others do.

Thank You!  I'll reinsert the summary block and see if that helps otherwise I'll await others responses.

Link to comment

Thanks for the clue on that one.  The issue was being caused by the summary block when the number of items exceeded the items per row by a large amount.  

I had the numbers of items set to the maximum 30 and then items per row set to 5. 

The issue is fixed when I set the number of items to 5 and items per row to 5.  It not ideal, but it is good enough and now everything lines up nicely.

THANKS!!

 

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.