Why Use CSS to Control How Your Page Loads?

CSS, or Cascading Style Sheets, are a wonderful tool in making a website efficient. It makes it simpler to make sitewide style changes without uploading the entire website over again. It makes it easier to test changes in the overall appearance of the site too.

But one of my favorite parts about using CSS is that I can use it to control the order in which elements of my pages load. I’d like to share why that’s important to me.

1. User Friendly

When people come to my site, the content is one of the first sections to pop up. If another element is taking time to load, such as an ad that is hosted offsite, they can still read what they came to see on my page. By the time they’re done, just about any unusually slow loading element will have loaded.

Most times this isn’t an issue. But when something loads slow, it’s nice to be able to give visitors something to look at so that maybe they won’t click away because the information they’re after isn’t showing up yet.

2. Potentially Search Engine Friendly

Some say that what a search engine sees early on in your page is a part of how they decide what the page is about. If you can get your content to be listed in your HTML before your navigation and other sections that are consistent from page to page, that could be a good thing for search engines.

It may also be helpful when the search engine grabs an excerpt from the page. It may increase the chances that the description shown will be text from the page, not the words from your navigation just because the relevant keyword was there too.

3. Load Potential Trouble Areas Late

I had an interesting problem here at the end of last week and over the weekend. My hosting company made some small change to their server, and that caused a script I use on many pages of my sites to fail, leading to incomplete loading of my pages.

Annoying, no?

Very much so, especially since I didn’t catch it right away. Those were rather busy family days and I wasn’t online much.

But aside from the error displaying, it didn’t make my site unusable.

That’s why I love using CSS to control the order in which parts of my website pages load. The script was one of the last things to load, and so my site could still be used, more or less. It was just some of my little extras, encouraging people to visit current forum topics and blog posts that were messed up.

I lost that function for a time, until the problem was figured out. I didn’t lose the entire function of my site, despite that visually those elements are above the content. They load at the very end instead, and my CSS code tells the browser to place those elements in the spaces at the top reserved for them.

I won’t say that having errors wasn’t frustrating since I still had most of my site working; it was! But the order in which my pages load made it an annoyance rather than a disaster.

You may also like...