Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Centering an SVG icon


I'm having trouble making icons look clean in Squarespace. The pngs I've uploaded are getting compressed in ways that make them look poor quality. So I'm trying to use SVG icons instead. I opened my SVG icon in a text editor, copy and pasted it into a code block in Squarespace and added width and height properties to size it. However, for the life of me I can't figure out how to center the icon. Screenshots attached of where I'm stuck and the code I'm currently using. Feel like I'm really close. 

Does anyone have a solution for this one?

Many thanks!

Screenshot 2019-12-07 12.24.04.png

Screenshot 2019-12-07 12.24.51.png

Share this post

Link to post

3 answers to this question

Recommended Posts

  • 0

Can you share link to your site?

or try wrapping all code in div tag

<div class="tuan">
  paste all svg code here

then insert the following code to Home > Design > Custom CSS

.tuan {
   text-align: center;
   margin-left: auto;
   margin-right: auto;


COVID-19Free priority support for all users (29/03 - 30/04). You can tag me (@tuanphan) or send to my email.

With paid support, see here

How to Setup Password & Share URL


Share this post

Link to post
  • 0

You are a genius! 

I don't have a pricing plan that allows full customization of css but I was able to wrap it in a div and apply your instructions directly inline. 

That works perfectly, thank you @tuanphan🙂

Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

  • Create New...