Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

gradient fails in IE8

Posted on 2010-09-09
3
Medium Priority
?
945 Views
Last Modified: 2012-08-13
Hi Experts,
I am trying to make a webpage with gradient background.  I need  it to be cross browser compatible.
The gradient seems to work all other browsers except IE 8. I know that microsoft changed it in IE8. i tried adding -ms-filter prefix but does not work.
I need to figure this out immediately.  Please help.
0
Comment
Question by:guyneo
3 Comments
 
LVL 40

Accepted Solution

by:
Gurvinder Pal Singh earned 1000 total points
ID: 33639714
0
 
LVL 12

Assisted Solution

by:Tony van Schaik
Tony van Schaik earned 1000 total points
ID: 33657820
This snippet should work:

But unless you are running your website in quirksmode it won't work.

<style>
	#gradient-with-stop {
		color: #fff;
		height: 100px;
		padding: 10px;
		/* For WebKit (Safari, Google Chrome etc) */
		background: -webkit-gradient(linear, left top, right top, from(#00f), to(#fff), color-stop(0.7, #fff));
		/* For Mozilla/Gecko (Firefox etc) */
		background: -moz-linear-gradient(left top, #00f, #fff 70%);
		/* For Internet Explorer 5.5 - 7 */
		filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=#FF0000FF, endColorStr=#FFFFFFFF, GradientType=1);
		/* For Internet Explorer 8 */
		-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#FF0000FF, endColorstr=#FFFFFFFF, GradientType=1)";
	}
</style>

<div id="gradient-with-stop">
	Gradient
</div>

Open in new window

0
 
LVL 1

Author Closing Comment

by:guyneo
ID: 33772904
Thanks Guys.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
The viewer will learn how to dynamically set the form action using jQuery.
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question