Squarespace CSS Codes
Scroll through the codes below to find answers to your Squarespace design questions.
Have questions? Need extra help? Get in touch!
-
@media only screen and (max-width: 640px){ p{font-size:.8rem!important}}
NOTE: There are six options for heading and paragraph text: H1, H2, H3, P1, P2, P3.
For P1 and P3, make sure to use .sqsrte-small and .sqsrte-large.
-
.sqs-block-content .image-block-outer-wrapper {
width: 50%;
height: 50%;
margin: auto;
}
NOTE: Adjust % as needed.
}
}
-
DESKTOP:
@media only screen and (min-width: 781px) {
#block-yui_3_17_2_1_1582128968110_6931{
display:none;
MOBILE:
@media only screen and (max-width: 780px) {
#block-yui_3_17_2_1_1577729296082_4473{
display:none;
}
}
NOTE: Use the Squarespace ID Finder extension in Chrome to identify your site's block id: https://chromewebstore.google.com/detail/squarespace-id-finder/igjamfnifnkmecjidfbdipieoaeghcff?hl=en&pli=1
-
@media only screen and (max-width: 640px) {
H1 {
word-wrap: normal;
-webkit-hyphens: none;
-moz-hyphens: none;
hyphens: none;
}
}
NOTE: There are six options for heading and paragraph text: H1, H2, H3, P1, P2, P3.
For P1 and P3, make sure to use .sqsrte-small and .sqsrte-large.
-
a {text-decoration-line:none !important;}
-
ALL BANNER VIDEOS:
section[data-current-styles*='"backgroundMode": "video"'] .section-background:after{
content: "";
position: absolute;
top: 0;
left:0;
height: 100%;
width: 100%;
opacity: .14;
background-color:black;
}
SINGLE BANNER VIDEO:
[data-section-id="SECTION_ID_HERE"] .section-background:after{
content: "";
position: absolute;
top: 0;
left:0;
height: 100%;
width: 100%;
opacity: .5;
background-color:blue;
}
NOTE: Use the Squarespace ID Finder extension in Chrome to identify your site's block id: https://chromewebstore.google.com/detail/squarespace-id-finder/igjamfnifnkmecjidfbdipieoaeghcff?hl=en&pli=1
-
Note: Add the code below to Code Injection (Footer) to get TikTok logos for TikTok links
<script>
var tiktoks = document.querySelectorAll('a[href*="tiktok"]')
tiktoks.forEach(item => {
item.innerHTML = `
<svg fill-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2" clip-rule="evenodd" viewBox="0 0 50 50">
<path fill-rule="nonzero" d="M37.006,22.323C36.779,22.344 36.549,22.358 36.316,22.358C33.693,22.358 31.388,21.009 30.047,18.97L30.047,30.507C30.047,35.216 26.229,39.034 21.52,39.034C16.811,39.034 12.993,35.216 12.993,30.507C12.993,25.798 16.811,21.98 21.52,21.98C21.698,21.98 21.872,21.996 22.047,22.007L22.047,26.209C21.872,26.188 21.7,26.156 21.52,26.156C19.116,26.156 17.168,28.104 17.168,30.508C17.168,32.912 19.116,34.86 21.52,34.86C23.924,34.86 26.047,32.966 26.047,30.562C26.047,30.467 26.089,10.968 26.089,10.968L30.105,10.968C30.483,14.559 33.382,17.393 37.006,17.653L37.006,22.323Z"/>
</svg>`
})
</script>
-
All pages
.header { display: none; }
section { padding-top: 0 !important; }
footer { display: none; }
section { padding-top: 0 !important; }
One page only
<style>
header, footer {display:none;}
</style>
-
Decrease:
[data-section-id="6006160448a95970869fbafd"] {
min-height: 0vh !important;
}
[data-section-id="6006160448a95970869fbafd"] .content-wrapper {
padding-top: 0px !important;
padding-bottom: 0px !important;
}
Increase
[data-section-id="607ae0ffe24f453c1b5fbb45"] .content-wrapper {
padding-top: 10px !important;
padding-bottom: 5px !important;
}
NOTE: Use the Squarespace ID Finder extension in Chrome to identify your site's block id: https://chromewebstore.google.com/detail/squarespace-id-finder/igjamfnifnkmecjidfbdipieoaeghcff?hl=en&pli=1
-
On homepage only
.homepage header#header {
background: transparent;
}
On any page
put code in that page’s settings
<style> header#header {
background: transparent;} </style>
-
On homepage only
.homepage a#site-title {
visibility: hidden;
}
On all pages
.header-title {
display: none;
}
-
@media only screen and (max-width: 640px) {
a.sqs-block-button-element {
padding: .8em 1.4em !important;
display: inline-block;
}
}
@media only screen and (max-width: 640px) {.sqs-block-button .sqs-block-button-element--large {
font-size: 16px;
} }
---JUST TEXT---
//Decrease button font-size on mobile
@media only screen and (max-width: 640px) {
#siteWrapper.site-wrapper .sqs-button-element--primary {
font-size: 0.7rem !important;
}
#siteWrapper.site-wrapper .sqs-block-button-element {
font-size: 0.7rem !important;
}
}
-
NOTE: add image "design> css > manage custom files"
.form-block{background-image:url(image url here); background-size:cover; border-radius:25px}
-
.item-pagination {
display: none;
}
-
.blog-item-title h1 {
display: none;
}
-
body {
border:15px solid #EAE0D8;
}header {
margin:15px 15px 0 15px;
}NOTE: Adjust size and color as needed
-
.header-nav-folder-content {
background: #000000 !important;
color: #FFFFFF !important;
a {
color: #FFFFFF !important;
}
}
NOTE: Adjust color as needed. For individual pages put it in <style> tags in that page’s settings
-
Note: put code in that page’s settings
<style>
#header {background-color: #111 !important;}
#header a {color: #fff !important;}
</style>
For mobile:
<style>
.burger-inner > div {
background-color: #ffffff !important;
}
</style>
-
NOTE: In your Squarespace menu, click Pages> Website Tools > Custom CSS
Scroll down and find the button that says Manage Custom Files.
Click Add Images or Fonts, and select your logo file from the window that pops up.
Once its uploaded click on the file and this will create a custom url.
Copy and paste the following CSS into the Advanced section of your page's settings.
<style>
.header-title-logo img {
visibility: hidden;
}
.header-title-logo a {
background-image: url(your url here);
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
}
</style>
-
Background
.sqs-gallery-controls .previous, .sqs-gallery-controls .next {
background-color: transparent;
}
Arrow
.sqs-gallery-controls .previous, .sqs-gallery-controls .next{color:black!important}
-
All
.sqs-block-image .design-layout-inline .intrinsic {
margin-left: 0!important;
}
Certain sections
section#your url .sqs-block-image .design-layout-inline .intrinsic {
margin-left: 0!important;
}
-
.code-block {
padding: 0 !important;
}
-
NOTE: Make sure to choose the “fade” animation effect
.gallery-fullscreen-slideshow-item-img{
transition: opacity 1600ms ease-in-out !important;
-webkit-transition: opacity 1600ms ease-in-out !important;
-ms-transition: opacity 1600ms ease-in-out !important;
-moz-transition: opacity 1600ms ease-in-out !important;
-o-transition: opacity 1600ms ease-in-out !important;
}
.gallery-fullscreen-slideshow[data-transition="fade"] .gallery-fullscreen-slideshow-item[data-active="true"] .gallery-fullscreen-slideshow-item-src{
transition: opacity 1400ms ease-in-out !important;
-webkit-transition: opacity 1400ms ease-in-out !important;
-ms-transition: opacity 1400ms ease-in-out !important;
-moz-transition: opacity 1400ms ease-in-out !important;
-o-transition: opacity 1400ms ease-in-out !important;
}
-
ALL PAGES
.header-title-logo {
display: none!important;
}
Homepage only
.homepage .header-title-logo {
display: none!important;
}
-
NOTE: In your Squarespace menu, click Pages> Website Tools > Custom CSS
Scroll down and find the button that says Manage Custom Files.
Click Add Images or Fonts, and select your font file from the window that pops up.
Once its uploaded click on the file and this will create a custom url.
Copy and paste the following CSS into the Custom CSS area.
@font-face { font-family: YOURFONT; src: url(); }
NOTE: Where it says YOURFONT, replace it with the name of your custom font. You can choose any name for this, but make sure that you remember the spelling as you’ll need to repeat this later on.
The next step is to add the URL of your font right between the two brackets ().
Whenever you upload a file inside Squarespace, it generates a URL for that file. This is the link that you’ll need to place inside the brackets.
The URL will automatically be added – and will look something like this:
@font-face { font-family: DM Sans; src: url(https://static1.squarespace.com/static/5e6a13436c6599388885b79d/t/5ee0d6ea3688515b59f562c1/1591793386569/DMSans-Regular.ttf); } }
Decide which Headings/Paragraphs you want to switch to your custom font, and copy and paste the appropriate CSS snippets.
h1 { font-family: 'YOURFONT'; }
h2 { font-family: 'YOURFONT'; }
h3 { font-family: 'YOURFONT'; }
h4 font-family: 'YOURFONT'; }
.sqsrte-large { font-family: 'YOURFONT'; }
p { font-family: 'YOURFONT'; }
.sqsrte-small { font-family: 'YOURFONT'; }
ADDING CUSTOM FONT TO OTHER ELEMENTS:
// Site Title //
.header-title-text a { font-family: YOURNAME !important; }
// Site Navigation //
.header-nav-item a { font-family: YOURNAME !important; }
// Button //
.header-actions-action .btn { font-family: YOURNAME !important; }
// Announcement Bar //
.sqs-announcement-bar-url a { font-family: YOURNAME !important; }
* This code is credited to woldandwild.co
-
div.header-announcement-bar-wrapper {
padding-top: 0px !important;
}
div.header-announcement-bar-wrapper {
padding-bottom
: 2px !important;
}
NOTE: Adjust heights as needed
-
.header-burger {display: none!important} .header-actions .btn, .header-actions .header-actions-action--cta {display:flex!important; visibility:visible; margin:auto!important; order: 2!important;}
-
@media screen and (max-width:767px) {
.header-title-logo {
text-align: center;
}
}
-
.sqs-block-summary-v2 {
.summary-title,
.summary-heading {
font-family: proxima nova;
font-weight: 600;
font-size: 18px !important;
color: #33cccc;
text-transform: uppercase;
font-style: italic;
} }
NOTE: Change font, sizes, colors, etc as needed.
-
.header-burger { //hamburger menu
display:flex!important}
.header--menu-open .header-menu {opacity: 1!important;visibility: visible!important;}
.header-nav, .header-actions {visibility:hidden!important}
-
//Show caption
.yui3-lightbox2 .sqs-lightbox-meta {
opacity: 1 !important;
background: #E76506 !important;
text-align: center;
font-size: 22px !important;
}
//Lightbox background
.yui3-lightbox2 .sqs-lightbox-overlay {
opacity: 0.7 !important;
}
.gallery-lightbox-background {
opacity: 0.7 !important;
}
Certain sections
section#your url .sqs-block-image .design-layout-inline .intrinsic {
margin-left: 0!important;
}
NOTE:
Adjust colors and sizes as needed.
-
hr { padding: 2px 0 2px 0; }
NOTE: Adjust sizes as needed
-
.gallery-fullscreen-slideshow[data-show-captions="true"][data-width="full-bleed"] {
margin-bottom: 70px !important;
}
NOTE: Adjust sizes as needed.
-
.header-menu-nav-item a {
font-size: 9px;
}
NOTE: Adjust size as needed.
-
.header-menu-nav-folder-content {
flex-grow: 0;
}
.header-menu-nav-folder {
justify-content: center;
}
-
@media screen and (max-width:767px) {
body.homepage .gallery-fullscreen-slideshow {
height: 30vh !important;
}
}
NOTE: Adjust height as needed.
-
.header-title-nav-wrapper {
flex: 1 0 90%;
}
.header-layout-nav-center .header-nav {
width: 100% !important;
flex: 1 1 100%;
}
-
All pages:
@media screen and (max-width:767px) {
div.gallery-block .slide
{ width: 33.333% !important;
}
}
One page:
<style>
@media screen and (max-width:767px) {
div.gallery-block .slide
{ width: 33.333% !important;
}
}
</style>
NOTE: Adjust % as needed.
1 per row + 100%
3 per row= 33.333%
-
.summary-item .summary-content {
display: flex;
place-items: center;
justify-content: center;
}
.summary-item .summary-content {
background: rgba(254,237,0,0);
position: absolute;
color: #fff !important;
top: 50%;
left: 50%;
opacity: 0 !important;
pointer-events: auto;
transition: all .1s ease;
transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
-moz-transform:translate(-50%, -50%)
}
.summary-item .summary-title, .summary-item .summary-metadata--primary, .summary-item .summary-metadata--secondary.summary-item .summary-excerpt {
color: #ffffff !important;
font-size:35px !important;
font-family: futura;
font-weight: 500;
letter-spacing: .08em;
text-transform: uppercase;
text-align:center !important;
background-color: rgba(3,255,255,0) !important;
}
.summary-item:hover .summary-content {
opacity:1 !important;
}
a.summary-thumbnail-container.sqs-gallery-image-container:after {
content: "";
background-color: rgba(0, 0, 0, 0.5);
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
}
.summary-item:hover a.summary-thumbnail-container.sqs-gallery-image-container:after {
opacity: 1;
}
NOTE: Adjust back ground and title colors as needed. Adjust text family, size, etc as needed.
-
.top-bun, .patty, .bottom-bun {height: 3px !important;}
-
NOTE: In your Squarespace menu, click Pages> Website Tools> Custom CSS
Scroll down and find the button that says Manage Custom Files.
Click Add Images or Fonts, and select your logo file from the window that pops up.
Once its uploaded click on the file and this will create a custom url.
Use the following code in Custom CSS
.header-menu .header-menu-bg{
background-image: url(IMAGE URL GOES HERE);
background-size: cover; }