Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Hansr

macrumors 6502a
Apr 1, 2007
897
1
Only include the image in the div or end it prior to the text or set the text class to 100%?
 

godrifle

macrumors 6502
Oct 20, 2003
268
117
Fort Thomas, KY
Use rgba to set the background color of the inner div, and skip using opacity completely.

Code:
<style>
	.outer {
		background: url(http://ecx.images-amazon.com/images/I/41XcuhQ0M3L._SY450_.jpg) no-repeat;
		width: 210px;
		height: 450px;
	}
	.inner {
		display: none;
		color: #fff;
		text-align: center;
		height: 100%;
	}
	.outer:hover .inner {
		display: block;
		background-color: rgba(0,0,0,.7);
	}
</style>

<div class="outer">
	<div class="inner">My text here</div>
</div>
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.