Sierracc Posted December 11, 2020 Posted December 11, 2020 (edited) Site URL: https://www.sierraccook.com/ Hello everyone! I am struggling to figure out how to change the height sections on mobile. On a desktop, the large height sections look great, but on mobile they are spread way too far apart. This is the amount of space on a desktop: And this is the amount of space on mobile: I would like for the distances to be about the same on both screens, and would also like for the images on mobile to be the same width. Since the images of the phones are actually background photos, changing the height of the sections on mobile causes them to shrink and moves them towards the center of the screen. I like that the images are mostly out of frame on mobile since there is much less screen space, so if there is a way to keep them like that and just fix the height of the sections, that would be lovely!! To anyone that could that help me, thank you so so much in advance! Edited December 11, 2020 by Sierracc grammar
tuanphan Posted December 13, 2020 Posted December 13, 2020 Add to Home > Design > Custom CSS @media screen and (max-width:767px) { [data-section-id="5fc983babe6684539de08e06"] { min-height: 20vh !important; } [data-section-id="5fc983babe6684539de08e06"] + section { min-height: 20vh !important; } [data-section-id="5fc998b4e4017829c1640852"] { min-height: 20vh !important; } } sageandsquare and Sierracc 1 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!)
Sierracc Posted December 13, 2020 Author Posted December 13, 2020 Thank you so much @tuanphan!!!!!!!! This solved my spacing issue perfectly!!!!!! However, now on mobile, the phone are mismatched, with the "Yelp Redesign" phone off frame and the other fully in frame. Is there a way to keep them all the same?
Sierracc Posted December 13, 2020 Author Posted December 13, 2020 @tuanphan Nevermind! I figured it out! It was an issue with the amount of space the titles and descriptions took up in each section. I revised them so they each use the same amount of lines/space. Thank you so much for your help!!!! tuanphan 1
tomalexander96 Posted January 4, 2022 Posted January 4, 2022 On 12/12/2020 at 8:53 PM, tuanphan said: Add to Home > Design > Custom CSS @media screen and (max-width:767px) { [data-section-id="5fc983babe6684539de08e06"] { min-height: 20vh !important; } [data-section-id="5fc983babe6684539de08e06"] + section { min-height: 20vh !important; } [data-section-id="5fc998b4e4017829c1640852"] { min-height: 20vh !important; } } I'm trying to similarly shrink a section on mobile, but the 20vh height isn't doing very much. Tried switching it to 0px and it barely made a dent, which was strange. Tuan, do you have any ideas? Site: https://www.lupoarms.com password: lupo CSS: .image-swap img{ position: absolute; height:auto; } .image-swap img { display: block; left: 50%; transform: translateX(-50%); } .image-swap img:nth-child(1) { z-index: 1; transition: .5s; } .image-swap img:nth-child(1):hover { opacity:0; } #block-yui_3_17_2_1_1641240410508_1657 { display: block; margin: 0 auto; width: 50%; } .container { background-color: #ff5733; width: 100%; height: 100%; margin: 0 auto; /*overflow: hidden;*/ } /*phone shrink*/ @media screen and (max-width:1200px) { [data-section-id="61d080f38e186f78e93ae953"] { min-height: 0px !important; } } /* Change dropdown menu background */ .header-menu-nav-item { background: #000000; }
tuanphan Posted January 5, 2022 Posted January 5, 2022 10 hours ago, tomalexander96 said: I'm trying to similarly shrink a section on mobile, but the 20vh height isn't doing very much. Tried switching it to 0px and it barely made a dent, which was strange. Tuan, do you have any ideas? Site: https://www.lupoarms.com password: lupo CSS: .image-swap img{ position: absolute; height:auto; } .image-swap img { display: block; left: 50%; transform: translateX(-50%); } .image-swap img:nth-child(1) { z-index: 1; transition: .5s; } .image-swap img:nth-child(1):hover { opacity:0; } #block-yui_3_17_2_1_1641240410508_1657 { display: block; margin: 0 auto; width: 50%; } .container { background-color: #ff5733; width: 100%; height: 100%; margin: 0 auto; /*overflow: hidden;*/ } /*phone shrink*/ @media screen and (max-width:1200px) { [data-section-id="61d080f38e186f78e93ae953"] { min-height: 0px !important; } } /* Change dropdown menu background */ .header-menu-nav-item { background: #000000; } Resize section on homepage? If reduce height, black space will appear. I think you can consider replace mobile background with new image. What do you think? 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!)
3van_hall Posted June 18, 2022 Posted June 18, 2022 @tuanphanI used your css code but how do I delete this white space on mobile. Looks fine on desktop any help, appreciated
tuanphan Posted June 20, 2022 Posted June 20, 2022 On 6/18/2022 at 9:50 PM, 3van_hall said: @tuanphanI used your css code but how do I delete this white space on mobile. Looks fine on desktop any help, appreciated Hi. What is your site url? 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