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 {
	background: #d1c26c; /* Old browsers */
	background-image: -moz-linear-gradient(top, #d1c26c 0%, #e5e2b9 22%, #d1cd96 66%, #b5a75c 100%); /* FF3.6+ */
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#d1c26c), color-stop(22%,#e5e2b9), color-stop(66%,#d1cd96), color-stop(100%,#b5a75c)); /* Chrome,Safari4+ */
	background-image: -webkit-linear-gradient(top, #d1c26c 0%,#e5e2b9 22%,#d1cd96 66%,#b5a75c 100%); /* Chrome10+,Safari5.1+ */
	background-image: -o-linear-gradient(top, #d1c26c 0%,#e5e2b9 22%,#d1cd96 66%,#b5a75c 100%); /* Opera11.10+ */
	background-image: -ms-linear-gradient(top, #d1c26c 0%,#e5e2b9 22%,#d1cd96 66%,#b5a75c 100%); /* IE10+ */
	background-image: linear-gradient(top, #d1c26c 0%,#e5e2b9 22%,#d1cd96 66%,#b5a75c 100%); /* W3C */
}
html.lte9 #example1 {
	-pie-background: linear-gradient(top, #d1c26c 0%,#e5e2b9 22%,#d1cd96 66%,#b5a75c 100%); /* CSS3 PIE */
	behavior: url('../../wp-content/themes/practicalcss3/css3-pie.htc'); /* IE6-9 */
	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:
    Examples now include new WebKit gradient (-webkit-linear-gradient(...)), but still have the old (-webkit-gradient(linear...)) for older WebKit browsers.
    Added Opera and Microsoft vendor prefixes, changing the CSS selector from html.ie to html.lte9 to prevent CSS3 Pie from affecting IE10.
    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 *