Background image opacity in Servoy 6

Questions and answers for designing and implementing forms in Servoy

Background image opacity in Servoy 6

Postby Ugo » Sat Nov 17, 2012 11:59 pm

Hello,

How would I do to set the opacity of a background image defined for the body part of a form without affecting other elements on that form ?
I tried several settings through my css stylesheet, but I can"t find a way around, everything on that form is rendered opaque.

Here's where I am so far

Code: Select all
   body.bkgrd{

           background-image: url("media:///myimage.jpg");
            background-color: grey;
            background-color : rgba(1,1,1,0.1);
            opacity: 0.4;
            background-repeat:no-repeat;
            background-position: center;
            background-size: cover;

      }


Thanks
Ugo Di Luca

SaaS Software Development Engineer ( Paris - France )
Cegid - http://www.cegid.fr
FileMaker Developer, trainer and consultant
DL Systems- http://www.dlsystems.fr
User avatar
Ugo
 
Posts: 28
Joined: Mon Dec 25, 2006 2:26 pm
Location: Paris, France

Re: Background image opacity in Servoy 6

Postby david » Wed Nov 21, 2012 3:17 pm

The opacity property by definition applies to the block element, not the background image. What you need is a background-opacity property but it doesn't exist yet.

The solution is to put a label on your form that fills the body part (with anchors as needed), send it to the back, and set its style class to:

Code: Select all
label.img-background {
   background-image: url("media:///myimage.jpg");
   background-color: grey;
   background-color: rgba(1, 1, 1, 0.1);
   opacity: 0.1;
   background-repeat: no-repeat;
   background-position: center;
   background-size: cover;
}
David Workman, Kabootit

Image
Everything you need to build great apps with Servoy
User avatar
david
 
Posts: 1727
Joined: Thu Apr 24, 2003 4:18 pm
Location: Washington, D.C.

Re: Background image opacity in Servoy 6

Postby Ugo » Wed Nov 21, 2012 6:58 pm

Thank you David,

that's the solution I came up with also

Ugo
Ugo Di Luca

SaaS Software Development Engineer ( Paris - France )
Cegid - http://www.cegid.fr
FileMaker Developer, trainer and consultant
DL Systems- http://www.dlsystems.fr
User avatar
Ugo
 
Posts: 28
Joined: Mon Dec 25, 2006 2:26 pm
Location: Paris, France


Return to Forms

Who is online

Users browsing this forum: No registered users and 5 guests