transparency of home page sections
Support Area › Forums › Moonrise › transparency of home page sections
- This topic has 5 replies, 2 voices, and was last updated 9 years, 5 months ago by Bill Robbins.
-
AuthorPosts
-
November 25, 2014 at 14:47 #24492Roman MartsinkevichParticipant
Hi Bill!
Could you be so kind to help me please!
i tried to make background for the home sections (one, two, three, etc) half transparent using the code like this, it’s the same like for the header, but I did it wrong probably, because nothing is change:body.fixed #one {
background-color: rgba(255,255,255,0.5);
}.home div#one {
margin-top: 0;
}Thank you in advance!
Best regards,
RomanNovember 25, 2014 at 16:33 #24494Bill RobbinsModeratorHello Roman,
Excellent question there. In this case, the home sections are all transparent. The color you see is the site’s overall background color. It’s applied to the “body” element of the page.
You could use a snippet like this:
body.fixed #one { background-color: rgba(255,255,255,0.5); }
to add a color to any of the home sections, but it won’t remove the color from the body that’s appearing there already.
If you have any questions, let me know.
Thanks,
BillNovember 26, 2014 at 01:54 #24498Roman MartsinkevichParticipantHi, Bill!
Thank you for quick response. I’ve try to do it but it doesn’t work, I use this snippet you provided here, nothing’s change.
In attachment you can find screen shot, as you can see white background behind the text is still exist and it’s absolutely solid, but I need it 50-40% transparent, I don’t want to close the photos on background.Thank you in advance for your help!
Attachments:
November 26, 2014 at 08:33 #24501Bill RobbinsModeratorRoman,
Sorry for the confusion there. Visually it looks like the block images are behind the text blocks, but as far as the browser is concerned they are not. Since they are not behind the text areas, it’s not possible to have those images visible through a semi-transparent background. What’s visible is the background that’s behind both the text AND the images.
Our eyes don’t see it that way, but that’s actually what’s happening here in creating the parallax scrolling effect.
So that snippet above adds a semi-transparent white on top of the gray. It doesn’t change the color very much, but it does ever so slightly. But since the image isn’t behind the text, that’s the only change.
BUT, I do believe that there is a way to achieve the effect you’re going for. What we can do is add the block image as the background of the home block. Then using a bit of additional CSS, create the semi-transparent background you’re going for. Here’s how:
- Go to your theme options page and choose the Advanced tab.
- Scroll down to the Custom CSS box and add this:
#two { height: 800px; background: url(https://voyagegourmet.com/wp-content/uploads/2014/11/2.jpg) center fixed; background-size: cover; position: relative; } .section-wrap { width: 100%; background-color: rgba(255, 255, 255, 0.50); } .section-wrap .widget { width: 100%; max-width: 960px; margin-left: auto; margin-right: auto; float: none; } @media only screen and (max-width: 767px) { #one, #two, #three, #four, #five, #six, #seven { background: transparent; } .section-wrap .widget { width: 90%; } }
- Update your settings.
That should give the second block a semi-transparent background that overlays your image. To add a similar effect for the other sections, take this snippet:
#two { height: 800px; background: url(https://voyagegourmet.com/wp-content/uploads/2014/11/2.jpg) center fixed; background-size: cover; position: relative; }
and duplicate it for the rest, just switching out the
http://voyagegourmet.com/wp-content/uploads/2014/11/2.jpg
for the corresponding image and the #two for the correct section.See if that doesn’t work for you. This is the first time I’ve given this a try, but it looks promising.
Bill
November 26, 2014 at 09:21 #24503Roman MartsinkevichParticipantWOW! 🙂 Thank you Bill! Probably i’ll try to do that, or will stay with a Foxy, it’s simpler to realize it there
November 26, 2014 at 10:49 #24507Bill RobbinsModeratorAlways glad to help out 🙂
-
AuthorPosts
- The topic ‘transparency of home page sections’ is closed to new replies.