Jump to content

Button alignment

Recommended Posts

Site URL: https://spinach-keyboard-w7ws.squarespace.com/fallsikringskurs

Hello!

I've made a two column layout with one button at the bottom of each column.

I would like to align the two buttons on the same horizontal level in desktop mode.

I know this can be achieved by adding a line break, before adding the two buttons. But this makes the layout display wrong on mobile, since the two columns breaks into one column (below each other) on mobile, and the buttons will then be placed at the bottom of both text boxes.

 

Any idea anyone?

Screenshot 2021-05-05 at 15.42.24.png

Screenshot 2021-05-05 at 15.43.36.png

Link to comment
  • Replies 3
  • Views 1.5k
  • Created
  • Last Reply
10 hours ago, Erlend-fs said:

Site URL: https://spinach-keyboard-w7ws.squarespace.com/fallsikringskurs

Hello!

I've made a two column layout with one button at the bottom of each column.

I would like to align the two buttons on the same horizontal level in desktop mode.

I know this can be achieved by adding a line break, before adding the two buttons. But this makes the layout display wrong on mobile, since the two columns breaks into one column (below each other) on mobile, and the buttons will then be placed at the bottom of both text boxes.

 

Any idea anyone?

Screenshot 2021-05-05 at 15.42.24.png

Screenshot 2021-05-05 at 15.43.36.png

Flexbox may help

@media only screen and (max-width: 768px) {
      section[data-section-id="6052fff2787304435eeb60b2"] .content > .sqs-layout .row:nth-child(2) {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: stretch; 
        align-content: center;
      }
      section[data-section-id="6052fff2787304435eeb60b2"] #page-section-6052fff2787304435eeb60b2 .row:nth-child(2) .sqs-col-6 {
        position: relative;flex-grow: 1;
      flex-shrink: 1;
      flex-basis: auto;width: 50%;
      }
      section[data-section-id="6052fff2787304435eeb60b2"] #page-section-6052fff2787304435eeb60b2 .row:nth-child(2) .sqs-col-6 .sqs-block-form {
        position: absolute;
        width: ~"calc(100% - 34px)";
        bottom: -50px;
      }
}

image.thumb.png.aa06bfb7eb80c6c44b78da7c2054e534.png

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

Works great!

I chose to use "min-width: 767px", since I am happy with how the page displays on mobile.

 

@media only screen and (min-width: 767px) {
      section[data-section-id="6052fff2787304435eeb60b2"] .content > .sqs-layout .row:nth-child(2) {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: stretch; 
        align-content: center;
      }
      section[data-section-id="6052fff2787304435eeb60b2"] #page-section-6052fff2787304435eeb60b2 .row:nth-child(2) .sqs-col-6 {
        position: relative;flex-grow: 1;
      flex-shrink: 1;
      flex-basis: auto;width: 50%;
      }
      section[data-section-id="6052fff2787304435eeb60b2"] #page-section-6052fff2787304435eeb60b2 .row:nth-child(2) .sqs-col-6 .sqs-block-form {
        position: absolute;
        width: ~"calc(100% - 34px)";
        bottom: -50px;
      }
}

 

 

Thanks a lot bangank36

Link to comment

@Erlend-fs Do you want to fix these?

Site URL – https://spinach-keyboard-w7ws.squarespace.com/

1. (Mobile-Homepage) Change to 2 logos/row?

spinach-keyboard-w7ws.squarespace.com-01

2. (Mobile-Homepage) Reduce this space?

spinach-keyboard-w7ws.squarespace.com-02

3. (Tablet-Munchmuseet) White bar on right of screen

spinach-keyboard-w7ws.squarespace.com-03

4. (Redningskurs) You haven’t changed SEO Title, so the browser tab name still shows “Services 1”

183467669_385591819270935_74453871601363

5. (Utstyrssalg) Similar on this page

spinach-keyboard-w7ws.squarespace.com-05

6. (Periodisk-kontroll) and some other pages

spinach-keyboard-w7ws.squarespace.com-06

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.