Jump to content

Help with centring

Recommended Posts

  • Replies 10
  • Views 578
  • Created
  • Last Reply

Top Posters In This Topic

1 hour ago, SeanCrafted said:

Site URL: https://www.ptmy-morpeth.co.uk/

Hi there, 

I am struggling to centre the text boxes on my homepage - https://www.ptmy-morpeth.co.uk/

Please can someone advise how I fix this - looks ok on mobile but not on desktop/laptop.


Cheers

Do you mean thing box?

image.thumb.png.55733e9c98480a737a8b76c3d53001ee.png

It seems Ok. Have you figured out?

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment
10 hours ago, SeanCrafted said:

Yes that's correct

Add to Design > Custom CSS

/* Mobile-Homepage-Center text */
@media screen and (max-width:767px) {
body.homepage article section:nth-child(n+2) .html-block * {
    text-align: center;
}
}

 

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
On 3/14/2022 at 2:21 AM, tuanphan said:

Add to Design > Custom CSS

/* Mobile-Homepage-Center text */
@media screen and (max-width:767px) {
body.homepage article section:nth-child(n+2) .html-block * {
    text-align: center;
}
}

 

Thing is I currently have this html in already, do I replace it?

/*1st section*/
section[data-section-id="61dda8e9afd08334af9f9a94"] {
    a {
        &:after {
            content: '';
            display: block;
            width: 100%;
            height: 100%;
            background: transparent;
            position: absolute;
            top: 0;
            left: 0;
        }
    }
    .content-wrapper {
        * {
            position: static;
        }
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        position: absolute !important;
        align-items: center;
    }
}

/*2nd section*/
section[data-section-id="61dda8876d090a490c87f020"] {
    a {
        &:after {
            content: '';
            display: block;
            width: 100%;
            height: 100%;
            background: transparent;
            position: absolute;
            top: 0;
            left: 0;
        }
    }
    .content-wrapper {
        * {
            position: static;
        }
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        position: absolute !important;
        align-items: center;
    }
}

/*3rd section*/
section[data-section-id="61dda984e4dcf868ea78e99b"] {
    a {
        &:after {
            content: '';
            display: block;
            width: 100%;
            height: 100%;
            background: transparent;
            position: absolute;
            top: 0;
            left: 0;
        }
    }
    .content-wrapper {
        * {
            position: static;
        }
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        position: absolute !important;
        align-items: center;
    }
}

/* Footer image */
div#block-yui_3_17_2_1_1643899665179_6702 {
    width: 50%;
    margin: 0 auto;
}

Link to comment
12 hours ago, SeanCrafted said:

Thing is I currently have this html in already, do I replace it?

/*1st section*/
section[data-section-id="61dda8e9afd08334af9f9a94"] {
    a {
        &:after {
            content: '';
            display: block;
            width: 100%;
            height: 100%;
            background: transparent;
            position: absolute;
            top: 0;
            left: 0;
        }
    }
    .content-wrapper {
        * {
            position: static;
        }
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        position: absolute !important;
        align-items: center;
    }
}

/*2nd section*/
section[data-section-id="61dda8876d090a490c87f020"] {
    a {
        &:after {
            content: '';
            display: block;
            width: 100%;
            height: 100%;
            background: transparent;
            position: absolute;
            top: 0;
            left: 0;
        }
    }
    .content-wrapper {
        * {
            position: static;
        }
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        position: absolute !important;
        align-items: center;
    }
}

/*3rd section*/
section[data-section-id="61dda984e4dcf868ea78e99b"] {
    a {
        &:after {
            content: '';
            display: block;
            width: 100%;
            height: 100%;
            background: transparent;
            position: absolute;
            top: 0;
            left: 0;
        }
    }
    .content-wrapper {
        * {
            position: static;
        }
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        position: absolute !important;
        align-items: center;
    }
}

/* Footer image */
div#block-yui_3_17_2_1_1643899665179_6702 {
    width: 50%;
    margin: 0 auto;
}

Don't remove any code in your current code. Add my code under

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
On 3/16/2022 at 4:57 PM, SeanCrafted said:

Hi There, I am still having issues with the centering on desktop?

 

The Restaurant needs to centred in the middle of image/page.

image.thumb.png.53b27ea7cf91866bc656b6c42069ee6c.png

Above code runs on mobile only. With desktop + Mobile, use this new code

body.homepage article section:nth-child(n+2) .html-block * {
    text-align: center;
}

 

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

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.