jess_h Posted August 4, 2023 Posted August 4, 2023 Is there a way to make sure my buttons don't overlap and are evenly spaced when the screen gets smaller? Thank you! Page: https://www.52launch.com/our-services
tuanphan Posted August 7, 2023 Posted August 7, 2023 Hi, How about forcing these to 2 rows on smaller screens? We can give code to achieve this 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!)
jess_h Posted August 7, 2023 Author Posted August 7, 2023 That could work! But I'm not sure if it will help with the uneven spacing that is also happening
tuanphan Posted August 8, 2023 Posted August 8, 2023 Actually to make same spacing, we will need to use Code Block to recreate these buttons. If you want to test this, let me know, we will give the code jess_h 1 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!)
Solution tuanphan Posted August 9, 2023 Solution Posted August 9, 2023 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!)
jess_h Posted August 9, 2023 Author Posted August 9, 2023 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?
jess_h Posted August 10, 2023 Author Posted August 10, 2023 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
tuanphan Posted August 12, 2023 Posted August 12, 2023 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 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> 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!)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment