tuanphan Posted November 26 Posted November 26 To add a floating button, you can follow these steps. #1. First, you can edit Site Footer and add a Button Block with desired url. #2. Find Button Block ID. In my example, it is: #block-yui_3_17_2_1_1732112517625_15057 #3. Use this code to Custom CSS box #block-yui_3_17_2_1_1732112517625_15057 { position: fixed; bottom: 10px; right: 10px; display: block !important; z-index: 99999; width: 250px; height: 50px; } body:not(.sqs-edit-mode-active) { footer.sections section, footer.sections { z-index: 99999 !important; }} Result: Button will float & sticky on bottom right corner when users scroll. #4. To make it float on bottom left corner, you can change right: 10px; to left: 10px; #5. To make float button appears on Mobile only, use this extra CSS code #block-yui_3_17_2_1_1732112517625_15057 { display: none !important; } @media screen and (max-width:767px) { #block-yui_3_17_2_1_1732112517625_15057 { display: block !important; } } #6. If you want to add 2 Floating button, you can add 2 button blocks to Footer. Then find ID. Suppose we have IDs: #block-yui_3_17_2_1_1732112517625_15057 and #block-0fcba09aec50928a077b Next, use CSS code like this to Custom CSS box #block-yui_3_17_2_1_1732112517625_15057, #block-0fcba09aec50928a077b { position: fixed; bottom: 10px; right: 10px; display: block !important; z-index: 99999; width: 250px; height: 50px; } #block-0fcba09aec50928a077b { bottom: 80px; } body:not(.sqs-edit-mode-active) { footer.sections section, footer.sections { z-index: 99999 !important; }} Result #7. If you want to make Floating button float on bottom of mobile site, use this new CSS code #block-yui_3_17_2_1_1732112517625_15057 { & { position: fixed; bottom: 0; left: 0; right: 0; display: none; z-index: 99999; width: 100%; height: 50px; } a { border-radius: 0 !important; background-color: #ece9e4 !important; } @media screen and (max-width:767px) { & { display: block !important; } }} body:not(.sqs-edit-mode-active) { footer.sections section, footer.sections { z-index: 99999 !important; }} Result #7.2. If 2 buttons, use code like this #block-yui_3_17_2_1_1732112517625_15057, #block-0fcba09aec50928a077b { & { position: fixed; bottom: 0; left: 0; right: 0; display: none; z-index: 99999; width: 50%; height: 50px; } a { border-radius: 0 !important; background-color: #ece9e4 !important; } @media screen and (max-width:767px) { & { display: block !important; } }} #block-yui_3_17_2_1_1732112517625_15057 { right: 50%; } #block-0fcba09aec50928a077b { left: 50%; } body:not(.sqs-edit-mode-active) { footer.sections section, footer.sections { z-index: 99999 !important; }} Result 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