Page 59 - CSS
P. 59

Background Color with Opacity


        If you set opacity on an element it will affect all its child elements. To set an opacity just on the
        background of an element you will have to use RGBA colors. Following example will have a black
        background with 0.6 opacity.


         /* Fallback for web browsers that don't support RGBa */
         background-color: rgb(0, 0, 0);

         /* RGBa with 0.6 opacity */
         background-color: rgba(0, 0, 0, 0.6);

         /* For IE 5.5 - 7*/
         filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000,
         endColorstr=#99000000);

         /* For IE 8*/
         -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000,
         endColorstr=#99000000)";



        Multiple Background Image


        In CSS3, we can stack multiple background in the same element.


         #mydiv {


        https://riptutorial.com/                                                                               37
   54   55   56   57   58   59   60   61   62   63   64