Re-imagination or Re-Booting - Post...

User 2073552 Photo


Registered User
1,625 posts

david wilson wrote:
SirAGE wrote:
david wilson wrote:
Opacity breaks my menu... who wood a thunk??


Can you give the code you used?


#mainnav{
width:58%;
margin-left:auto;
margin-right:auto;
margin-top:.5em;
min-height:36px;
border-radius: 15px;
box-shadow: 4px 4px 5px #000000;
background-color:#FFFFFF;
opacity: 0.80;
}


I'm thinking if i set the background to an rgb color and set the opacity there might be more fruitful.


In your #mainsection add
z-index:-100;


And that should fix your problem. :D
"An Apple doth not fall far from its tree, yet an orange does."

https://lbwebsitedesign.com - Responsive Web Design & Web Hosting Services.
http://helpsite.sirage.com - HTML5, CSS3 and CC Help Video Blog.
User 184085 Photo


Ambassador
1,707 posts

Exact a mun-do, but why did this not show up until i set opacity?
Volunteering to help :)
http://www.tbaygeek.ca
My HTML play area
http://www.tbaygeek.ca/test/
User 2073552 Photo


Registered User
1,625 posts

david wilson wrote:
Exact a mun-do, but why did this not show up until i set opacity?


Because you have a position of Relative on the mainsection ID. Where as there is no position placed on the nav element.

Z-index is relative to the stacking order. Which means z-index only applies to content of a positioned ancestor. Which is where the relative, absolute and fixed positioning come in.

So basically... lol

Your nav has no positioning, but the box under it does. It is set to relative.

When you set the nav to an opacity it also apply to ANYTHING under it. So you are saying I want the nav to be an opacity of .8 including anything below it so it will now go under something that has a position.

I am not doing a good job of explaining.

But...

There is a simpler way to fix the issue. And that is just by giving your nav a position of relative and a z-index of 1.
"An Apple doth not fall far from its tree, yet an orange does."

https://lbwebsitedesign.com - Responsive Web Design & Web Hosting Services.
http://helpsite.sirage.com - HTML5, CSS3 and CC Help Video Blog.
User 2073552 Photo


Registered User
1,625 posts

Ok, thought about how to explain it better... lol

When you position an element or box or anything you are telling that item to come UP Off the page... When you use relative positioning you are telling the box to come up off the page but stay where it is...

When you position something absolutely you are telling the box to come up off the page and over top everything else.

So... That being said, your maincontent box is position of relative. So it is sitting on top of the page right where the code is sitting.

When you tell something that is still sitting on the page to have an opacity you are then making the item on the page have a lower Z-Index then that of the relative (Up off the page) box.

So, to fix it give the nav a position of relative and a z-index of 1 to say: I want the nav to come up off the page and sit in front of anything that is also up off the page...

Does that make sense to anyone???
"An Apple doth not fall far from its tree, yet an orange does."

https://lbwebsitedesign.com - Responsive Web Design & Web Hosting Services.
http://helpsite.sirage.com - HTML5, CSS3 and CC Help Video Blog.
User 184085 Photo


Ambassador
1,707 posts

Perfect sense.. thanks, I'll adjust things and see what else pops up :)
Volunteering to help :)
http://www.tbaygeek.ca
My HTML play area
http://www.tbaygeek.ca/test/
User 184085 Photo


Ambassador
1,707 posts

Still having a small issue with opera and safari spacing the elements, but made good progress today. The position and z-index combo was exactly the fix i needed.
Volunteering to help :)
http://www.tbaygeek.ca
My HTML play area
http://www.tbaygeek.ca/test/
User 184085 Photo


Ambassador
1,707 posts

Did some reorganizing of the site to hopefully please google a little, and managed to make all the menu levels see through with colours.

Fully html5 and css3 with lots of comments to clarify what I'm doing at what point.

Thanks to everyone for your ideas and suggestions :)
Volunteering to help :)
http://www.tbaygeek.ca
My HTML play area
http://www.tbaygeek.ca/test/

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.