Error in IE with linear-gradient background property

Discussion in 'CSS' started by тнє Sufi, Sep 28, 2012.

  1. #1
    Below is the CSS code I am using for a submit button. It is working perfectly on all browsers, except IE. I am using latest version of IE. Button background color is not loading.
    
    .dbox input[type="submit"]{
    	background: -moz-linear-gradient(center top , #99CA4B 0pt, #66991C 100%) repeat scroll 0 0 padding-box transparent;
    	background: -ms-linear-gradient(center top, #99CA4B, #66991C);
    	background: -webkit-gradient(linear, 0 0, 0 100%, from(#99CA4B), to(#66991C));
    	background: -webkit-linear-gradient(center top, #99CA4B, #66991C);
    	background: -o-linear-gradient(center top , #99CA4B 0pt, #66991C 100%) repeat scroll 0 0 padding-box transparent;
    	background: linear-gradient(center top , #99CA4B 0pt, #66991C 100%) repeat scroll 0 0 padding-box transparent;
    	padding: 1px 10px;
    	color: #FFFFFF;
    	height: none;
    	margin: -1px;
    	}
    
    Code (markup):
    Can someone guide me how to fix?
    Thanks.
     
    тнє Sufi, Sep 28, 2012 IP
  2. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #2
    1) I don't believe IE supports that complex selector... are your paddings and margin adjustments being applied too?

    2) attempting to size and input is unpredictable/unreliable cross browser, so attempting a 1px margin adjust is probably broken too, especially if you aren't stating vertical-align.

    3) which IE -- if you're looking at versions prior to IE9 there is no linear-gradient.

    3) CSS without the markup it's applied to is gibberish.

    4) linear gradients are really slow in some browsers, I'd suggest sucking it up, using an image with background-size, and align it so a fallback background color will match the fade.
     
    deathshadow, Sep 28, 2012 IP
  3. ntmedia

    ntmedia Active Member

    Messages:
    118
    Likes Received:
    11
    Best Answers:
    7
    Trophy Points:
    90
    #3
    Make another file for IE and put this conditional:

    
    <!--[if IE]>
    	<link rel="stylesheet" type="text/css" href="ie.css"/>
    <![endif]-->
    
    Code (markup):
    In that CSS write this

    
    [LEFT][COLOR=#3E3E3E].dbox input[type="submit"] {
    background: url(linktoimage.png) repeat-y;
    }
    [/COLOR][/LEFT]
    Code (markup):
    Just make a screenshot of what it looks like and cut it to image with 1px width (the smaller the better), and change background URL. And then when an IE users arrives they'll use specific file instead of the main one. Only that line will be overwritten though. The rest will come from main CSS file
     
    ntmedia, Oct 6, 2012 IP
  4. furqanartists

    furqanartists Well-Known Member

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    101
    #4
    You can use CSS3PIE ( http://css3pie.com/ ). CSS3PIE is a tool which makes Internet Explorer 6-9 capable of rendering several of the most useful CSS3 decoration features.

    Here is a gradient example:

    [URL]http://css3pie.com/demos/gradient-patterns/[/URL]
    Code (markup):
     
    furqanartists, Oct 9, 2012 IP