By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,739 Members | 1,081 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,739 IT Pros & Developers. It's quick & easy.

cleaning up the css

P: n/a
Yay. I ran a web site optimization test, and it informed me that even on
pages that didn't need them, the background images for other pages that are
on the style sheet are included as part of the file size being downloaded.

I did not know that. Amazing (that I am willing to admit I didn't know that
until tonight. Doh)! I took some of the style rules for background pages
that usually only applied to three pages each and moved those styles to the
heads of those pages. I reduced the file size of the html file being tested
by 13K (from 35K to 22K) and reduced the size of the stylesheet itself from
11.4 K to 10.4 K.

I'm sure I can clean up the style sheet a lot more if I look at it again,
especially with help (hint hint). The existing style sheet at
http://www.TheBicyclingGuitarist.net/css/style.css was at one time NINE
separate stylesheets that I then cobbled all together back in 2002 or 2003
(with lots of help from this newsgroup).

Thanks y'all.

Feb 3 '08 #1
Share this Question
Share on Google+
6 Replies


P: n/a
The Bicycling Guitarist wrote:
Yay. I ran a web site optimization test, and it informed me that even on
pages that didn't need them, the background images for other pages that
are on the style sheet are included as part of the file size being
downloaded.
That depends on the browser, at least some do not download background images
until they find an element that the rule applies to. This has resorted in a
number of tricks being used to preload images for rollovers (sprites being
one of the more popular).

--
David Dorward
http://dorward.me.uk/
http://blog.dorward.me.uk/
Feb 3 '08 #2

P: n/a
On Feb 3, 6:16*am, "The Bicycling Guitarist"
<Ch...@TheBicyclingGuitarist.netwrote:
Yay. I ran a web site optimization test, and it informed me that even on
pages that didn't need them, the background images for other pages that are
on the style sheet are included as part of the file size being downloaded.
The only browser I ever noticed doing that was Mac IE (can't remember
which version(s)). I was working on a site with several big background
images and noticed that Macs were very slow to load the first page.

I don't believe that any commonly used modern browser does this.

Easy to test: add a reference to an image in a selector that will
never actually get used. Then check your server logs to see of that
image ever gets downloaded.

Steve
Feb 3 '08 #3

P: n/a

"The Bicycling Guitarist" <Ch***@TheBicyclingGuitarist.netwrote in message
news:47**********************@read.cnntp.org...
Yay. I ran a web site optimization test, and it informed me that even on
My web site is going to grow up. I am leaving Windows IIS to go to Unix
hosting. I am leaving Microsoft FrontPage that I have used to manage my web
site many years since I've hand coded all the HTML in Notepad to avoid the
proprietary and invalid code FP generates. I am almost certainly quitting
membership in over a hundred webrings since the WebRing management recently
expressed arrogant disdain and contempt for w3c standards. It's going to be
a brand new day.

um, still grateful for any help on improving the code such as it is. Thanks
www.TheBicyclingGuitarist.net/
Feb 3 '08 #4

P: n/a
The Bicycling Guitarist wrote:
"The Bicycling Guitarist" <Ch***@TheBicyclingGuitarist.netwrote in message
news:47**********************@read.cnntp.org...
>Yay. I ran a web site optimization test, and it informed me that even on

My web site is going to grow up. I am leaving Windows IIS to go to Unix
hosting. I am leaving Microsoft FrontPage that I have used to manage my web
site many years since I've hand coded all the HTML in Notepad to avoid the
proprietary and invalid code FP generates. I am almost certainly quitting
membership in over a hundred webrings since the WebRing management recently
expressed arrogant disdain and contempt for w3c standards. It's going to be
a brand new day.

um, still grateful for any help on improving the code such as it is. Thanks
www.TheBicyclingGuitarist.net/
It is always with trepidation that we embrace newness.

Oh, hell. No sugar coating. It's a Brave New World. Good luck!
--
Ed Mullen
http://edmullen.net
http://mozilla.edmullen.net
http://abington.edmullen.net
Why do we drive on parkways and park on driveways?
Feb 4 '08 #5

P: n/a
Ed Mullen wrote:
The Bicycling Guitarist wrote:
>"The Bicycling Guitarist" <Ch***@TheBicyclingGuitarist.netwrote in
message news:47**********************@read.cnntp.org...
>>Yay. I ran a web site optimization test, and it informed me that even on

My web site is going to grow up. I am leaving Windows IIS to go to
Unix hosting. I am leaving Microsoft FrontPage that I have used to
manage my web site many years since I've hand coded all the HTML in
Notepad to avoid the proprietary and invalid code FP generates. I am
almost certainly quitting membership in over a hundred webrings since
the WebRing management recently expressed arrogant disdain and
contempt for w3c standards. It's going to be a brand new day.

um, still grateful for any help on improving the code such as it is.
Thanks
www.TheBicyclingGuitarist.net/

It is always with trepidation that we embrace newness.
I've embraced newness before. But it got old after a while. Such is
the nature of the web.

Jeff
>
Oh, hell. No sugar coating. It's a Brave New World. Good luck!

Feb 5 '08 #6

P: n/a
On 3 Feb, 06:16, "The Bicycling Guitarist"
<Ch...@TheBicyclingGuitarist.netwrote:
Yay. I ran a web site optimization test, and it informed me that even on
pages that didn't need them, the background images for other pages that are
on the style sheet are included as part of the file size being downloaded.
So what?

They'll be wanted pretty soon, when users nav to other pages. If they
only bother to read one page, screw them 8-)

Slowness in downloading them isn't an issue, other than possible
slowdown to the rest of your page. It doesn't matter if they haven't
loaded immediately, you couldn't see them anyway.

Think of it as "image pre-loading" instead. Back in the '90s, people
used to embed chunks of JavaScript on each page to achieve this!

Caching (between client and server) will take care of the rest. Let
the network layer worry about it.
Feb 7 '08 #7

This discussion thread is closed

Replies have been disabled for this discussion.