开发者

Web Design: opacity on images for my website

开发者 https://www.devze.com 2023-02-15 20:57 出处:网络
i\'m buildling a website and I want to create a translucid menu. I know that .gif image types enable transparency, but from my experience, not translucidy(anything betwee开发者_开发百科n being transpa

i'm buildling a website and I want to create a translucid menu. I know that .gif image types enable transparency, but from my experience, not translucidy(anything betwee开发者_开发百科n being transparent and opaque) - by default it seems to set the opacity to 100%, ie a solid image without any translucity/transparency.

I'm not sure if the issue is with the file type, or with how I'm exporting my menu. If it's worth anything, I'm using Fireworks to create and export my menu.

As is, I'm exporting my seperate files for my menu as .pngs, which seem to support translucent images, but I know that I'll be wanting to reduce the file size of these images soon, so is there a better alternative to getting a semi-transparent image other than using the .png file type?

Thanks, Patrick


I'd say PNG is probably the best bet. The more modern browsers (read: not IE6) understand the 8-bit alpha channel it provides, whereas GIFs just have the transparency key.

Often these days, the bottleneck on sites isn't the size of the image (either in dimensions or in data) but rather the number of requests that it takes to load a page. More modern website designs try to pack as many images into one using techniques like CSS Spriting (woot.com, most of google). The other bottleneck is often not setting caching up correctly, forcing return visitors to reload a bunch of stuff.

You'll see google's various pages caching everything it can, and reducing the number of things a single page needs to download (combine all Javascripts into one, all CSS stylesheets into one) so that the browser is make 2 and 3 requests instead of 15-20.

I'd go with PNGs, and look into CSS sprites and caching as an alternative optimization.

See here for an example of an image sprite used on google's homepage.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号