Preloading images with CSS

/* at the bottom of the stylesheet */ body::before { content: url(../img/bg_home.jpg) url(../img/bg_services.jpg) url(../img/bg_portfolio.jpg) url(../img/bg_about.jpg) url(../img/bg_contact.jpg); display: none; }
I know... it's a bit hacky, but in some cases and especially for small websites, this can be useful :)

2 Responses

Hey... are you stealing my snippet and even get more likes? :)
True that, you are not even improving it, just raw copy & paste.

Write a comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.