472,111 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,111 software developers and data experts.

cleaning up the css

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
6 1519
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
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

"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
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
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
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.

Similar topics

1 post views Thread by StinkFinger | last post: by
1 post views Thread by Matej Cepl | last post: by
6 posts views Thread by sheffdog | last post: by
3 posts views Thread by Pierre Saint-Jacques | last post: by
13 posts views Thread by jadionne | last post: by
12 posts views Thread by Santosh | last post: by
1 post views Thread by Mikey | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.