-
AuthorPosts
-
May 28, 2015 at 1:37 pm #284831
Hello,
Just wondered what the css would be to change the opacity of the background image on a page while hovering. Is it possible to get 2 different css codes – 1 that would change the opacity of every background image on a page and one that would only target each “section” i.e. section 1 or section 2 (which used to be column I believe).
I have a code that used the x-column band style which is no use once working with cornerstone.
Thanks
May 28, 2015 at 9:35 pm #285317Hi Fiona,
Thanks for writing in! The opacity on a background image is kind of tricky but let see what we could do. Please provide us the site url. I think the second one does not need a custom css, as CornerStone provide option to set a background on each Section. http://prntscr.com/7am1kx
Cheers!
May 29, 2015 at 4:06 pm #286189This reply has been marked as private.May 30, 2015 at 7:30 am #286726Hi There,
Thanks for your information.
Try adding following CSS under Appearance > Customize > Custom > CSS:.x-face-content:hover { background-color: rgba(0, 0, 0, 0.5); }
Hope it helps.
June 1, 2015 at 2:00 pm #288926Hi,
When I put that in it only did so for the card element which is bizarre. I’ve changed my mind about it now but would still be good to know for future reference.
Thanks
June 2, 2015 at 1:54 am #289483Hi there,
Please try this :
.x-section:hover:before { position: absolute; top: 0; left: 0; bottom: 0; right: 0; width: 100%; height: 100%; background-color: rgba(0,0,0, 0.5); content: ''; display: block; }
Hope it helps.
June 2, 2015 at 1:48 pm #290098Hi,
Thanks this works but it does it for the whole page as opposed to just one section. How would I specify it to be just one section? Would I have to give it a class? I’m not sure.
June 3, 2015 at 5:18 am #290796Hi Fiona,
Yes, you can add a class to your section then change the code according to your class name.
For example if you added a class hover-background change your css code to this.
.x-section.hover-background:hover:before { position: absolute; top: 0; left: 0; bottom: 0; right: 0; width: 100%; height: 100%; background-color: rgba(0,0,0, 0.5); content: ''; display: block; }
http://screencast.com/t/jZuHkQ42jW
Hope that helps.
February 25, 2016 at 6:04 am #811862Hi, sorry to pick up this thread again – I searched for ages for this, and your code solved it – just one thing I’d like to change it round: I would like the opacity of .5 originally (not mouse-over) and it to be clear (opacity: 0) on hover.
With your code it’s obviously clear/transparent originally and semi-opague on hover.
Is that possible?
I am applying this to a column with background image behind text links.
Thanks !February 25, 2016 at 7:51 am #811984Hi,
You can add a unique class to your column.
eg. Add my-column
You can then add this in your custom > css
.x-column.my-column { background-color: rgba(0,0,0, 0.5); } .x-column.my-column:hover { background-color: rgba(0,0,0, 0); }
If that doesn’t help please provide us your site url so we can provide you a tailored code to your situation.
Thanks
-
AuthorPosts