CMS Development

spencer93
Teilnehmer/-in

Text Overlap on Mobile Landing Page

lösung

Hello, 

 

I am having trouble with text on a header image staying within the header image on a landing page when viewed on mobile. The text is overlapping with a video that is a just below the header image. How can I keep the text contained within the header image when viewed on mobile. 

 

Thanks!

0 Upvotes
1 Akzeptierte Lösung
Jsum
Lösung
Autorität

Text Overlap on Mobile Landing Page

lösung

@spencer93,

 

Check out your css:

.custom-banner {
    background: transparent;
    background-repeat: no-repeat;
    background-position: right-center;
    background-size: cover;
    width: 100%;
    height: 500px;
    position: relative;
}

Your banner has a fixed height applied to it. There are two options to help you. 

 

1. remove the fixed height, period. Fixed heights should be avoided when possible, especially when styling containers of editable fields in cms templates, because you never know how short or long the content will end of being and with a fixed height there is no adjusting for this.

.custom-banner {
    background: transparent;
    background-repeat: no-repeat;
    background-position: right-center;
    background-size: cover;
    width: 100%;
    height: 500px;
    position: relative;
    padding: 60px 0;
}

Add some bottom and top padding instead and let your section flex.

 

2. If you absolutely feel the need to use fixed height on your banner, you'll want to use a media query to change the height for mobile, around the width where the issue starts:

@media (max-width: 490px) {
     .custom-banner {
        height: 800px;
    }
}

as a side note, I would also consider using a media query to change your font-size and line-height on the your banner content for mobile.

Lösung in ursprünglichem Beitrag anzeigen

0 Upvotes
6 Antworten
Jsum
Autorität

Text Overlap on Mobile Landing Page

lösung

@spencer93,

 

can you share a link?

0 Upvotes
spencer93
Teilnehmer/-in

Text Overlap on Mobile Landing Page

lösung
0 Upvotes
Jsum
Autorität

Text Overlap on Mobile Landing Page

lösung

The link you shared is to the page editor in your portal, I don't have credentials to access it. You'lll need to share a preview link.

0 Upvotes
spencer93
Teilnehmer/-in

Text Overlap on Mobile Landing Page

lösung
0 Upvotes
Jsum
Lösung
Autorität

Text Overlap on Mobile Landing Page

lösung

@spencer93,

 

Check out your css:

.custom-banner {
    background: transparent;
    background-repeat: no-repeat;
    background-position: right-center;
    background-size: cover;
    width: 100%;
    height: 500px;
    position: relative;
}

Your banner has a fixed height applied to it. There are two options to help you. 

 

1. remove the fixed height, period. Fixed heights should be avoided when possible, especially when styling containers of editable fields in cms templates, because you never know how short or long the content will end of being and with a fixed height there is no adjusting for this.

.custom-banner {
    background: transparent;
    background-repeat: no-repeat;
    background-position: right-center;
    background-size: cover;
    width: 100%;
    height: 500px;
    position: relative;
    padding: 60px 0;
}

Add some bottom and top padding instead and let your section flex.

 

2. If you absolutely feel the need to use fixed height on your banner, you'll want to use a media query to change the height for mobile, around the width where the issue starts:

@media (max-width: 490px) {
     .custom-banner {
        height: 800px;
    }
}

as a side note, I would also consider using a media query to change your font-size and line-height on the your banner content for mobile.

0 Upvotes
spencer93
Teilnehmer/-in

Text Overlap on Mobile Landing Page

lösung

Great! Thanks so much for your help. 

0 Upvotes