Posts Tagged ‘css’

IE6 PNG Transparency CSS background-repeat Fix

Sunday, December 9th, 2007

Couple of people around the forums and here commented that none of the current Internet Explorer 6 PNG scripts provide fix for the issue of using png image as CSS repeated background (background-repeat: repeat/repeat-x/repeat-y).

Therefor with no generic solution at this time I thought of three possible workarounds:

  1. Use sizingMethod=’scale’
  2. Use flash for rendering the png
  3. Make as much as needed areas and repeat with Javascript

Here I will explain the first one since it was the easiest to try.

The idea is very simple just use filter: progid: DXImageTransform.Microsoft.AlphaImageLoader(enabled=’true’, sizingMethod=’scale’, src=’the-image-you-want-to-repeat.png’ ) and make sure you properly apply the other CSS rules. This technique uses scaling instead of repeating but for shadows and other cool effects it is sufficient.

End result and demo following:

Preview for IE6 PNG background-repeat

For more info see the demo under Internet Explorer 6

CSS Standard Fonts for Websites

Tuesday, November 20th, 2007

With Vista released Microsoft replaced the “Standard Web Fonts” with the so cold “C fonts” – Cambria, Calibri, Candara, Consolas, Constantia, and Corbel. To take advantage of them (if available on the user’s computer) you can use the following font-family CSS definitions.

1
2
3
4
5
6
7
8
9
10
11
font-family: Helvetica, Calibri, Arial, sans-serif; /* or */
 
font-family: Corbel, Verdana, "Bitstream Vera Sans", sans-serif; /* or */
 
font-family: Candara, "Trebuchet MS", Trebuchet, sans-serif; /* or */
 
font-family: Cambria, "Times New Roman", Times, serif; /* or */
 
font-family: Constantia, "Palatino Linotype", Palatino, Georgia, serif; /* or */
 
font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace;

If you don’t have the “C” fonts you can download and install Microsoft’s Powerpoint Viewer 2007 which contains them.

For visual comparison check this pdf