Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oversized transparent divs manipulate LCP calculation #129

Open
loader3788 opened this issue Jan 14, 2025 · 0 comments
Open

Oversized transparent divs manipulate LCP calculation #129

loader3788 opened this issue Jan 14, 2025 · 0 comments

Comments

@loader3788
Copy link

Another LCP hack is active and heavily used again:

<style>
#main-page {
    position: absolute;
    font-size: 1200px;
    line-height: 1;
    word-wrap: break-word;
    top: 0;
    left: 0;
    width: 96vw;
    height: 96vh;
    max-width: 99vw;
    max-height: 99vh;
    pointer-events: none;
    z-index: 99999999999;
    color: transparent;
    overflow: hidden;
}
</style>

<div id="main-page" data-optimizer="layout"></div>

Placing it near the opening <head> completely nullifies the LCP calculation, as the browser incorrectly considers the invisible, oversized element as the largest contentful paint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant