• Tech
  • Science
  • Entertainment
  • Culture

Automatically Change Background Color on Refresh in Blogger

FacebookX (Twitter)WhatsAppLinkedIn

blogger-logoHave you ever wondered to provide your visitors with a fresh look everytime they refresh your blog or maybe visit one or another article, well now with easy CSS and JavaScript's hacks you can apply few easy tweaks that can make your work a lot easier. Well yes we are talking about changing our blog's background color everytime a person refreshes your blog, so he would be greeted with a new background color.

So I do not have any demo for this effect but I am using this effect at the time of posting this article so if you are reading this article pretty late you might not be able to see this effect, but it's a simple CSS overriding effect so it simply adds a new color HEX code everytime a person refresh's your blog and color's are randomly selected. So if you wish to add this effect to your blogger blog just check below  steps.

  1. Open Blogger > Template > Edit HTML.
  2. Now press Ctrl + F and search for </head> tag & paste below code above it.

    <script>$(function(){function e(){return"rgb("+Math.round(Math.random()*255)+", "+Math.round(Math.random()*255)+", "+Math.round(Math.random()*255)+")"}$("body").each(function(t){$(this).css("background",e())})})</script>

  3. Now just Save Template and refresh your blog to see this effect.

So now everytime you refresh your blog you will see background color changing randomly, so you open any post and you will see different color. So that's it hope you guys liked this article, if you find any problem do comment.

Older Posts
  • Funny WhatsApp and Hilarious Facebook Status Updates
    Funny WhatsApp and Hilarious Facebook Status Updates
  • Blogger Conditional Tags b:if and b:else for More Blog Customizations
    Blogger Conditional Tags b:if and b:else for More Blog Customizations
  • Top 9 Websites for Watching Movies Streaming Online for Free
    Top 9 Websites for Watching Movies Streaming Online for Free
  • Watch Indian Television Channels using VLC Media Player
    Watch Indian Television Channels using VLC Media Player
  • Naughty 18+ NON-VEG Jokes for WhatsApp and Facebook
    Naughty 18+ NON-VEG Jokes for WhatsApp and Facebook

Stay Ahead of the Curve

Join thousands of readers getting our best tech and culture stories delivered straight to their inbox.

About UsContactPrivacy PolicyTerms of Service
FacebookX (Twitter)InstagramYouTube
© HackingUniversity - Hacks . Tricks . How-To's. All rights reserved.