1

I was trying to put a background image on my website, and then put a gradient on it, it works well in chrome but not in IE11. i use this style for chrome :

background: linear-gradient(to top, rgb(26 179 148 / .9), #3f9480),url(../img/pattern.jpg);

it should be look like this(chrome) and this for IE11 :

background-image: -ms-linear-gradient(bottom, #1ab394 0%, #3f9480 100% ),url(../img/pattern.jpg);

it looks like this in IE11 but it only shows the gradient, how do I put the URL(img)?

Pif
  • 530
  • 2
  • 10
  • 20

2 Answers2

1

Try this out in a new HTML file not directly in your project

Html:

    <div class="tab">
       <div class="gradient"><!--
         Your input fields go here
         -->
       </div>
       <div class="container"></div>

    </div>

CSS:

        .gradient {
        width: 100%;
        position: absolute;
        height: 100px;
        background-image: -ms-linear-gradient(bottom, #1ab394 0%, #3f9480 100%);
        opacity: 0.9;
    }

    .container {
        background-image: url('pattern.jpg');
        width: 100%;
        height: 100px;
    }

This is what it looks like in my IE11 enter image description here

This is the best I can do I hope you like it

Twak
  • 127
  • 11
1

You can use the same CSS setting for both Chrome and IE11 but need to change the definition of the color that has the transparency.

Use:

background: linear-gradient(to top, rgba(26,179,148, .9), #3f9480),url(gear.jpg);

You don't need the -ms- prefix for IE11 as it deals with linear-gradient now. It just ignored the original transparency setting.

A Haworth
  • 30,908
  • 4
  • 11
  • 14