How to 'clip away' part of a div using CSS?

Zoe238

New Member
This is more or less a scaled down version of what I got, but it's not what I want, as I want the green div to be partially transparent, so I'll be able to see whatever content is behind both of these divs (there is none in the example, but there is in my project). But the other div is blocking my view, so how would I 'clip away' part of that div?Just a thought, there might even be a better method to solve this.Just in case the link is broken:HTML:\[code\]<div id="foregrounddiv2"></div><div id="foregrounddiv"></div>?\[/code\]CSS:\[code\]#foregrounddiv2 { background-color:grey; width: 100%; height: 100%; left: 0; top: 0; position: fixed; z-index:2;}#foregrounddiv { background-color: green; position: fixed; z-index: 3; width: 100px; height: 100px; left: 50%; top: 50%; margin-top: -50px; margin-left: -50px;} \[/code\]UPDATE: Sorry for the misunderstanding. The text I was talking about is situated behind both divs. Sorry about the bad naming too. I don't want any opacity on the \[code\]#foregrounddiv2\[/code\] div, I just want to be able to see the content through \[code\]#foregrounddiv\[/code\]. Hope I make sense.
 
Back
Top