Site logo

Archived topic

Padding on mobile and tablet

17 replies · Started by Justin on September 15, 2022

Viewing posts 1–15 of 18

Hey,

My padding on mobile and tablet seems to have been lost on posts:
https://humanhealth.je/empowered-by-your-food/

In customiser - layout - container - content padding. I have 20px padding set. I also have a layout element making posts 800ox wide, which aplies to desktop.

But I'm not sure why my mobile and desktop padding has dropped out? The page actually loads with the padding for a second, then they loose their padding.

Turing off the post layout element fixes the issue. But then makes my posts the full container width.

So, how can I set my posts to have a 800px container on desktop, and retain their padding on mobile? I don't want to change the sitewide width to 800 as it makes my header contained and not full width.

Thanks for your help

Hi Justin,

In Appearance > Customize > Layout > Container, can you check the Content Layout setting, if it's set to One Container? If not, can you try setting it to that?

Hey, it is set to separate containers. But setting as single containers doesn't resolve the issue.

When I set as single container, the padding / margin at the top of the page is lost.

Is there a best practice for setting the width of posts and post padding?

I have an element layout set up, with these settings:
Content Area - Contained (no padding)
Content Width - 800 px

When I disable that, the issue resolves. But, then my posts are full width on desktop.

I can set the content width in the customiser, but then my header becomes contained.

So I assume the solution is to delete the element, set the page container in customise-layout to be 800px wide, and find a way to then ensure the header goes full width?

If that makes sense? :)

Yes, that makes sense.

Yes, you're suggested solution is one approach to do it. Then, we can unset the max-width for the Header with this CSS:

.inside-header.grid-container {
    max-width: unset;
}

You may add this in Appearance > Customize > Additional CSS.

That works perfect for the blogs, but the CSS doesn't work for my header. For ref, I am using the following code to centre the header and this is the site:

https://humanhealth.je/

/* Centre logo */
@media(min-width: 769px) {
.inside-header>.site-branding,
.inside-header>.navigation-branding,
.inside-header>.site-logo,
.site-branding-container,
#site-navigation .navigation-branding .site-logo,
#sticky-navigation .navigation-branding {
position: absolute;
left: 50%;
transform: translateX(-50%);
z-index: 1000;
}

#site-navigation {
margin-left: unset !important;
display: flex;
}

#site-navigation,
#primary-menu,
.main-navigation .inside-navigation {
flex: 1;
}

/* Change nth-child(#) to first item to right */
.main-navigation ul li:nth-child(4) {
margin-left: auto;
}
}
/* Centre logo */

Try this as well:

.inside-navigation.grid-container {
    max-width:unset;
}

Perfect thank you :)

I have one other thing on this site. When I view on desktop, all heading fonts have the correct 500 weight applied. But on mobile, they seem to have started to default to 900 weight.

Any idea what could be causing that?

Can you point us to an example Heading in your site so we can observe the issue?

https://humanhealth.je/what-is-chiropractic/

If you look on mobile (I am using chrome on an iPhone) all headings are around 900 weight. Including all of the navigation.

On desktop, they are how they should be, 600

I see. It seems to be 600 on my end on mobile as well/ Can you try clearing your browser's cache? If that doesn't work, try viewing it on a different device.

When I check mobile on my computer, it appears fine.

But when I check on my phone on safari and chrome, all titles display at 900. I have also tested on other devices and cleared cache. It is odd as this arose recently.

Also, on safari, pages seem to have 20px margin off the side?

Have you tried on a different device? Does the issue occur there as well?

Hey Fernando - yes I tried on a friends iPhone - same issue

Hi there,

this is what i see on my iphone:

https://www.screencast.com/t/wUT9mGnPlAiK

I used the Safari Developers tools to duplicate one of the headings.
The second heading is the original and i leave that as font-weight 600
The first heading i toggle between 600 and 900 font-weights.

There is a difference, although Poppins doesn't make a big show of it.

How do the font-weights on my screen recording compare ?

This archived topic is closed to new replies.