Making the snippet smaller on mobile | Community
Skip to main content
Answered

Making the snippet smaller on mobile


Hi everyone, I am trying to make the snippet on my Shopify-based site less invasive. Is there a way to hide it on mobile or force a resizing to a smaller button and font? Thanks a million!

 

Best answer by mathio-tf

Hello @Chengst88!

To hide the button on mobile you can do it using CSS:

<style>
/* hide the button on screens narrower than 600px */
@media only screen and (max-width: 600px) {
  .typeform-sidetab-button {
    display: none;
  }
}
</style>

 

You can use the same approach to resize the button too. It requires a bit more playing around with the embed code, but the idea is the same - use CSS media query to format the button based on screen size.

I created and example you can use as base for your own code:

https://glitch.com/edit/#!/tf-sidetab-responsive-button?path=index.html

Edit: I updated the solution above to target the button by correct class name.

View original

12 replies

mathio-tf
Typeform
Forum|alt.badge.img+5
  • Typeform
  • 888 replies
  • Answer
  • April 26, 2021

Hello @Chengst88!

To hide the button on mobile you can do it using CSS:

<style>
/* hide the button on screens narrower than 600px */
@media only screen and (max-width: 600px) {
  .typeform-sidetab-button {
    display: none;
  }
}
</style>

 

You can use the same approach to resize the button too. It requires a bit more playing around with the embed code, but the idea is the same - use CSS media query to format the button based on screen size.

I created and example you can use as base for your own code:

https://glitch.com/edit/#!/tf-sidetab-responsive-button?path=index.html

Edit: I updated the solution above to target the button by correct class name.


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14956 replies
  • April 28, 2021

Hi @Chengst88 Hope you’re doing well! :hugging: Did the solution above work for you? 


belinda_long
Forum|alt.badge.img+2
  • Socializer
  • 44 replies
  • November 23, 2021
mathio wrote:

Hello @Chengst88!

To hide the button on mobile you can wrap the whole snippet in a custom parent element and hide it using CSS:

<div class="my-tf-button">
  <!-- your typeform embed code here -->
</div>

<style>
/* hide the button on screens narrower than 600px */
@media only screen and (max-width: 600px) {
  .my-tf-button {
    display: none;
  }
}
</style>

 

You can use the same approach to resize the button too. It requires a bit more playing around with the embed code, but the idea is the same - use CSS media query to format the button based on screen size.

I created and example you can use as base for your own code:

https://glitch.com/edit/#!/tf-sidetab-responsive-button?path=index.html

hey @mathio , just tried to apply this to my Typeform sidebar too but the sidebar is still showing up on the mobile version of my site 🤔 I want it completely hidden from my mobile site & just have it show on anything iPad and above (min-width: 641px). Site is Squarespace. Screenshots & code below, if you could help me troubleshoot that would be fab 🙏🏼TIA! 

WEBSITE LINK: 

https://belindalong.co/concept-to-company-program

 

CODE: 

 

MOBILE SITE SCREENSHOT: 

 


mathio-tf
Typeform
Forum|alt.badge.img+5
  • Typeform
  • 888 replies
  • November 23, 2021

Hello @belinda_long 

sorry, I was wrong about wrapping the code in parent element. You will need to target the button by its own class name typeform-sidetab-button instead.

Like this:

@media only screen and (max-width: 641px) {
  .typeform-sidetab-button {
    display: none;
  }
}

 


belinda_long
Forum|alt.badge.img+2
  • Socializer
  • 44 replies
  • November 30, 2021

Hey @mathio, thanks for following up, appreciate it! Unfortunately it still doesn’t seem to work for me, even if I add !important afterwards :(

Not sure what I’m doing wrong, gah but will just remove the sidebar until I have more time to troubleshoot – thanks anyway!


mathio-tf
Typeform
Forum|alt.badge.img+5
  • Typeform
  • 888 replies
  • November 30, 2021

Hello @belinda_long we have recently updated class names used in embed. Correct class name should be tf-v1-sidetab-button. You can confirm the class name by inspecting the element in your browser.

Please keep in mind that though it is not very likely to happen we can change those class names without prior notice as this is more a hack rather than a feature we officially support.


belinda_long
Forum|alt.badge.img+2
  • Socializer
  • 44 replies
  • December 1, 2021

Gotchya, thank you! Still a newbie when it comes to using chrome inspect (and coding in general) so apologies for my ignorance 😭appreciate your help! @mathio 


mathio-tf
Typeform
Forum|alt.badge.img+5
  • Typeform
  • 888 replies
  • December 1, 2021

No problem. Were you able to customize your snippet using the classname I posted above?


belinda_long
Forum|alt.badge.img+2
  • Socializer
  • 44 replies
  • December 7, 2021

Will take another look at it once I’ve got this moving countries thing sorted ;) will let you know! @mathio cheers!


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14956 replies
  • December 7, 2021

Good luck on the move, @belinda_long !!


  • Navigating the Land
  • 2 replies
  • December 24, 2022

Hi! Is there a way to offset the button and move it a little up or down by a number of pixels?


mathio-tf
Typeform
Forum|alt.badge.img+5
  • Typeform
  • 888 replies
  • December 27, 2022

Hi @AmbigramPL , you can use the tf-v1-sidetab-button classname, eg like this:

.tf-v1-sidetab-button {
  top: 10% !important;
}

 


Reply