Sridhar Katakam's Weblog

Center Google Search Results

Posted on May 25, 2021 | 0 comments

Updated on 24 Jan 2026

I am currently using a 4K 27″ LG monitor with display resolution set to 2048 x 1152.

Google search results page seems to be annoyingly stuck in 90s with the search results floating to the left and this is especially noticeable on larger screens.

There is a Chrome extension called Center Google Search Results. While it is okay, the end result could be better.

I tweaked the CSS of the google search results using Stylus.

Before:

After:

Here’s the custom CSS:

.ufC5Cb {
    grid-column: 2/span 16;
}

/* Center the entire page */
body {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Center the header search box */
[role="search"] {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 20px 0;
}

/* Center the Google logo */
a[href*="webhp"] {
  display: flex;
  justify-content: center;
}

/* Center the navigation menu */
nav {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* Center the search results */
main {
  width: 100%;
  max-width: 700px;
  margin: 20px auto;
  padding: 0 20px;
}

/* Ensure results container is centered */
[data-sokoban-container] {
  max-width: 700px;
  margin: 0 auto;
}

/* Center footer */
footer {
  width: 100%;
  display: flex;
  justify-content: center;
}

.tsf {
    max-width: none;
}

@media (min-width: 1461px) {
    .A8SBwf {
        margin-left: 0;
    }
}

@media (min-width: 940px) {
    .FgNLaf {
        display: none !important;
    }
}

.A8SBwf {
    width: 500px;
}

#searchform {
    margin-top: -20px;
}

I use AdGuard, uBlock Origin etc. and do not see ads. Further tweaking may be needed if ads are visible.

Leave the first comment