Jump to content

Stop buttons from overlapping

Go to solution Solved by tuanphan,

Recommended Posts

  • Solution
Posted

Add a Code Block under Our Services Text > Add this code (I haven't adjusted code for mobile yet)

<!-- Button Block - Code Block -->
<div class="button-code-block">
<!-- design -->
<div class="sqs-block button-block sqs-block-button">
	<div class="sqs-block-content">
		<div class="sqs-block-button-container sqs-block-button-container--center">
			<a href="#design" class="sqs-block-button-element--medium sqs-button-element--primary sqs-block-button-element">design</a>
		</div>
	</div>
</div>
<!-- manufacture -->
<div class="sqs-block button-block sqs-block-button">
	<div class="sqs-block-content">
		<div class="sqs-block-button-container sqs-block-button-container--center">
			<a href="#manufacture" class="sqs-block-button-element--medium sqs-button-element--primary sqs-block-button-element">manufacture</a>
		</div>
	</div>
</div>
<!-- market  -->
<div class="sqs-block button-block sqs-block-button">
	<div class="sqs-block-content">
		<div class="sqs-block-button-container sqs-block-button-container--center">
			<a href="#market" class="sqs-block-button-element--medium sqs-button-element--primary sqs-block-button-element">market</a>
		</div>
	</div>
</div>
<!-- brand -->
<div class="sqs-block button-block sqs-block-button">
	<div class="sqs-block-content">
		<div class="sqs-block-button-container sqs-block-button-container--center">
			<a href="#brand" class="sqs-block-button-element--medium sqs-button-element--primary sqs-block-button-element">brand</a>
		</div>
	</div>
</div>
</div>
<style>
.button-code-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.button-code-block a {
    padding-top: 1.2rem !important;
    padding-bottom: 1.2rem !important;
}
</style>

 

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!)

Posted

Thank you!! So so close. It's looking a lot better, however because the word "manufacture" is longer than the other words, the button is overflowing into the space to the left and right of it instead of pushing the other buttons a little to the side to make even spacing between the buttons. It would be perfect if that word wasn't longer than the others. Is there anything that would prevent that from happening?Screenshot2023-08-09at10_44_41AM.thumb.png.0cd64cae0086c8ca42753de14f9fcd70.png

Posted

I got it working for the most part by adding

width: 100%;
margin-left: 5%;
margin-right: 5%;

within .button-code-block a . I'm not an expert so let me know if that will work consistently or if there's a better way. Now I just need the piece to make it stack on a smaller screen size

 

Posted
On 8/10/2023 at 8:51 PM, jess_h said:

I got it working for the most part by adding

width: 100%;
margin-left: 5%;
margin-right: 5%;

within .button-code-block a . I'm not an expert so let me know if that will work consistently or if there's a better way. Now I just need the piece to make it stack on a smaller screen size

 

It looks fine to me

image.thumb.png.039772c0140dc1ab24416a9a86d86f28.png

With smaller screen, add this to bottom of Code Block

<style>
  @media screen and (max-width:1024px) and (min-width:768px) {
  .button-code-block .button-block {
    width: 50% !important;
    margin-bottom: 20px;
}
.button-code-block {
    flex-wrap: wrap;
}

  }
</style>

image.png.1e5d20ce02b72fc83ee58775f0ad2a91.png

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!)

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.