Site logo

Archived topic

CSS not working on 404

17 replies · Started by Annamari on October 6, 2021

Viewing posts 1–15 of 18

Hi,

a mistery for me... The CSS I'd like to add to my 404 page isn't working. Neither in the child theme style.css, nor in the Custom CSS field.

.error404 .page-hero .404-inner {
    max-width: 500px; 
    background-color: rgba(255,255,255,0.4); 
    padding: 40px;
}

.error404 .page-hero .404-inner h1 {
    text-align: center; 
    font-size: 160px;
}

What am I doing wrong?

Thanks,
Annamari

Hi Annamari,

Try this:

.error404 .page-hero .\34 04-inner {
    max-width: 500px; 
    background-color: rgba(255,255,255,0.4); 
    padding: 40px;
}

.error404 .page-hero .\34 04-inner h1 {
    text-align: center; 
    font-size: 160px;
}

Let me know :)

Hi Ying,

It works! 👏 Thank you!

(Now I'd like to understand why this is the solution... :))

You are welcome!

It's just a CSS rule, you could do some study on this

Since it's not theme related, I won't keep on discussing here :)

I need correct one more thing on this page, the overflow on mobile. Just would like to understand how to do this...

Why doesn't it work as on the other pages? If it's not theme related, then what influences this?

Thanks for any insight...

Your site info has been erased, can you link us to your site again and also paste the CSS you used for overflow on mobile as well?

Hi Ying,

I just added

html, body {
    overflow-x: hidden;
}

which seems to work everywhere, except on the 404 page.

(Now I understand what was the problem earlier: I started the div class with a number, which is not recommended.)

Thanks!

Hi there,

I've checked the and it seems to be applying fine. Perhaps you've sorted this out already? Let us know. :)

Hi Elvin,

no, it's still not okay for me on the 404 page. I checked it on multiple devices on mobile (please see the triangle under the logo).

Hi there,

might be better to try fixing the overflow issue.

Instead of this CSS:

@media screen and (max-width: 480px) {
    .inside-header::before {
        left: -60px;
    }
}

Try this:

@media screen and (max-width: 482px) {
    .site-header .inside-header::before {
        left: unset;
        right: 0;
    }
}

Yay, perfect, thank you David!

Glad to be of help!

Another mystery... The overflow is still present on one page on mobile... We can't figure out what causes it. (Added the URL in the private information area.)

David, could you have a look? Thanks!

Can you disable cache plugin so we can see the code better?

Disabled, sorry.

This archived topic is closed to new replies.