Enhance Your Web Browsing with Custom CSS

When searching for content on a specific subject, it can be frustrating to be bombarded with distracting click-bait thumbnails.

YouTube homepage: original (left) and customised (right)

Fortunately, Safari on Mac has a helpful feature that allows you to add a custom CSS stylesheet.

In order to enable custom CSS in Chrome or FireFox you’d need an AddOn such as Tampermonkey or CustomCSSforFx respectively (I haven’t tested them tho).

YouTube video page: original (left), customised (right) – without ‘suggestions’ sidebar.
YouTube video page with chat: original (left), customised (right) – without ‘suggestions’ sidebar.

However, other web browsers may require an additional extension to customize page appearance.

The code

/* YT */
#related,
ytd-section-list-renderer[page-subtype="home"],
#masthead-ad,
ytd-rich-grid-renderer,
ytd-mealbar-promo-renderer
{
    display:none !important;
}
ytd-browse[page-subtype="home"] {
    background-color:gray;
    /* here is my YT background wallpaper, leave it or use a different url */
    background-image:url('https://webshare.mattr.co.uk/youtube-bgd.jpg');
    background-size:cover;
	background-attachment:fixed;
    background-position:50% 50%;
	min-height:90vh;
}
#content {
	min-height:100%;
}

If you’re interested in viewing whatever the YouTube algorithm has come up with, even with a “cleaned” homepage, simply click on the “Trending” link.

The ‘Trending’ link on customised YouTube homepage.

A little extra

For those looking to enhance the readability of Wikipedia articles, here’s a CSS snippet that can help. It changes the default, tiny, sans-serif font to a slightly larger Georgia font and limits the length of a verse.

/* Wikipedia */
.mediawiki .mw-content-ltr {
	font-family: Georgia, serif;
	font-size: 17px;
	line-height: 1.6em;
}
.mediawiki .mw-content-ltr p {
	max-width: 36em;
}
Wikipedia article: original (left), customised (right)
Wikipedia article: original (left), customised (right)

Conclusion

In just a few lines of custom CSS code, you can improve the appearance of your favorite websites and even remove unwanted content.

You may also like…

12 Comments

Anonymous
Thanks. Handy, unfortunately I can't seem to get any other jpg to render. I'm curious what the limitation is there.
Anonymous
The css hides things that are important on YouTube such as when viewing a channel's page and clicking on Videos…
Anonymous
thanks a lot mate
Anonymous
Thank you so much!!!
Anonymous
Thank you so much!
Anonymous
Thank you for this tweak a lot!
Anonymous
Can you use it on your iPad as well? Wenn so how?
Anonymous
When I'm in the videos section of a channel, I want to see their videos on their channel but it's…
Anonymous
What is the CSS for doing this on a cellphone with something like "MakeOver - CSS" in the App Store
Anonymous
thanks
Anonymous
thanks a lot!
Anonymous
cool