CSS3 PIE

CSS3 PIE is an HTC file that allows you to use standard CSS3 (plus vendor prefixes) to get features such as linear background gradients, rounded corners and drop-shadows in all browsers. HTC files are applied using a behavior in your CSS, which is IE-only, and does not validate.

#example1 {
	-moz-box-shadow: 5px 5px 0 #666; /* FF3.5+ */
	-webkit-box-shadow: 5px 5px 0 #666; /* Saf3.0+, Chrome */
	box-shadow: 5px 5px 0 #666; /* Opera 10.5, IE9+, W3C  */
}
html.lte8 #example1 {
	behavior: url('../../wp-content/themes/practicalcss3/css3-pie.htc'); /* IE6-8 */
	zoom: 1; /* 'hasLayout' required for HTC method */
}

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Another example with a “connected”, “soft edge” shadow look:

#example2 {
	-moz-box-shadow: 5px 5px  5px #666; /* FF3.5+ */
	-webkit-box-shadow: 5px 5px  5px #666; /* Saf3.0+, Chrome */
	box-shadow: 5px 5px  5px #666; /* Opera 10.5, IE9+, W3C  */
}
html.lte8 #example2 {
	behavior: url('../../wp-content/themes/practicalcss3/css3-pie.htc'); /* IE6-8 */
	zoom: 1; /* 'hasLayout' required for HTC method */
}

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

One Response to CSS3 PIE

  1. aarontgrogg says:

    Updated:
    Changed the CSS selector from html.ie to html.lte8 to prevent CSS3 Pie from affecting IE9+, since they already understand border-radius.
    Re-ordered the declarations to list the W3C-version last, so as browser implement the standard, it will be the one that affects page elements.

    Cheers,
    Atg

Leave a Reply

Your email address will not be published. Required fields are marked *