Okay
  Public Ticket #3533861
CTA Text overflow on mobile
Closed

Comments

  •  1
    Zac Trout started the conversation

    I have several sections of my site where the button text overflows the element it's in on mobile. I've tried adjusting the padding and the margins, but all that does is make the button look funky. I would like for the button text to wrap to the next line instead of flowing off the page. Is there a CSS hack for this, or a setting I'm missing? 

    Thanks!

    Attached files:  Screenshot 2023-11-30 at 11.53.35 AM.png

  •  1,661
    Judith replied

    Hi Zac,

    Thanks for writing to us.

    Please enable the responsive settings from here and see whether that helps:

    6864650455.png

    Please let us know how this goes.

    Best Regards.

  •  1
    Zac Trout replied

    Thanks Judith. I have that setting turned on, however, that's not a true fix for my problem as it's still a guessing game at that point and not a bulletproof fix for all scenarios. The CTA I'm currently trying to have text wrap for is "Send us a Message". If I shrink the responsive text setting to 90% in this case, it solves the issue. But if my CTA were something like "Send us a Message Today", then it would overflow again. So, setting a hard number is not a fix. I would much rather just have the text wrap to the next line so it reads like this:

    Send us a
    Message

    Is there an easy way to do that?

  •  1
    Zac Trout replied

    I found a case where the button text wraps, however, the width of the button background still goes way off the edge of the page.

    Attached files:  Screenshot 2023-11-30 at 3.00.24 PM.png

  •  1,661
    Judith replied

    Hi Zac,

    Thanks for writing back.

    Please share the page URL of the screenshot you have referenced as we are not able to locate it from the URL shared.

    I look forward to hearing from you.

  •  1
    Zac Trout replied

    Sorry, that was on this page: https://zact36.sg-host.com/about/our-teams/

  •  1,661
    Judith replied

    Hi Zac

    Thanks for writing back.

    To make the changes as requested, you will need to add some custom CSS code. To do this, please follow these steps:

    From your WordPress dashboard, Navigate to Salient > General Settings > CSS/Script Related. In the custom code area, insert the provided CSS snippet:

    @media only screen and (max-width: 690px){
    .nectar-cta.font_size_desktop_18px, .nectar-cta.font_size_desktop_18px * {
        width: 54vw;
    }
    }

    Once the code is added, save and refresh the page to see if the change has been applied. In case it helps, please check this section from the documentation on CSS/Script Related

    If this does not work as expected or If you have any further questions or need additional assistance, don't hesitate to write back, I'm happy to help. 


  •  1
    Zac Trout replied

    That partially fixed the issue. However, the button text is not vertically centered on the button. Also, it didn't seem to affect buttons where the text is within the main page margins because the button edge still goes outside of the margin making it look odd. 

    Attached files:  Screenshot 2023-12-01 at 11.06.23 AM.png
      Screenshot 2023-12-01 at 11.06.51 AM.png

  •  1,661
    Judith replied

    Hi Zac,

    Thanks for writing back.

    Please add this css as well:

    @media only screen and (max-width: 690px){
    .nectar-cta.font_size_desktop_18px, .nectar-cta.font_size_desktop_18px * {
        line-height: 15px;
        top: 5px;
    } }

    I hope this helps.

    Best Regards.

  •  1
    Zac Trout replied

    This is still only working in specific instances, vs a universal rule. So with that extra CSS, it works for the "Find Service Opportunities" button, but not for the "Send us a Message" or "Community Partners" buttons further down the page. Is there a way to write the CSS that applies to a broad set of cases?

    Attached files:  Screenshot 2023-12-01 at 11.36.41 AM.png
      Screenshot 2023-12-01 at 11.36.57 AM.png
      Screenshot 2023-12-01 at 11.37.03 AM.png

  •  1,661
    Judith replied

    Hello Zac,

    Thanks for writing back.

    To assist you better, we'd love to have a closer look at your setup and to do this, we'll need admin login credentials 

    (dashboard URL, username, password) to your site. This will enable us to conduct a more in-depth investigation of the issue based on your specific configurations. Would you mind sharing this with us? 

    If you prefer, you can safely share the access through a one-time secret note or using an access plugin such as Controlled Admin Access.

    Before you provide this information, we strongly recommend taking a backup of your site.

    If you have any concerns or questions about this process, please don't hesitate to let me know.

    Best regards,


  •   Zac Trout replied privately
  •  8,453
    Tahir replied

    Hey Again,

    I see you were able to resolve this by reducing the CTA font size. See screenshot: 

    6436185510.png

    Thanks.


    ThemeNectar Support Team 

  •  1
    Zac Trout replied

    Tahir, that particular instance might work for your selected screen aspect ratio (iPhone 14 Pro Max). However, there are still multiple places on the site where the button text overflows on smaller screens. The CTA text is different depending on the situation, so I need a universal rule that can cover all scenarios (similar to how my text just naturally wraps to the next line as I'm typing in this text box). 

    I'm sure there are other instances, but here are a few where I've found the issue (or some version of the issue):

    Attached files:  Screenshot 2023-12-19 at 1.15.09 PM.png
      Screenshot 2023-12-19 at 1.17.29 PM.png
      Screenshot 2023-12-19 at 1.19.21 PM.png

  •  8,453
    Tahir replied

    Hey Again,

    The easiest option is to reduce the font on such screen sizes.

    Add this into the Custom CSS box in your Salient Theme Options panel (We write all Custom CSS in the Live Browser to ensure accuracy. If you cannot see any changes, make sure there is no red cross in the Custom CSS Box as any syntax error would cause all CSS under that line of code to not show up on the Frontend):

    @media only screen and (max-width: 390px) {
        .nectar-cta {
            font-size:14px !important;
        }
    }

    Thanks


    ThemeNectar Support Team