How can I edit my css to adjust the opacity on the background image in the hero unit without affecting the opacity of the text etc in the hero unit? Here is the draft site (yes i'll be paying for proper version of the photo): site
Asked
Active
Viewed 1.0k times
0
-
Why don't you just make it transparent in photoshop? (or something similar) – adaam May 23 '13 at 19:33
-
Read this http://stackoverflow.com/a/7241440/2198378 – jeyraof May 23 '13 at 19:36
-
I don't have photoshop and if grew impatient with GIMP rather quickly :) – vt97john May 23 '13 at 21:35
2 Answers
2
The easy answer is to take your .jpg, and create a .png with it that has your opacity already applied.

Robert McKee
- 21,305
- 1
- 43
- 57
0
One way would be to move your hero text outside of the hero unit and use position:relative
to place it where you want...
CSS
.hero-unit {
background-image:url('..');
height:300px;
opacity: .5;
}
h1 {
position: relative;
top: -350px;
left: 40px;
color:#fff;
}
HTML
<div class="container">
<div class="hero-unit">
</div>
<h1>Hello Hero Text</h1>
</div>
This example assumes your hero text it contained in an H1, but it could be in any container outside of the hero.

Carol Skelly
- 351,302
- 90
- 710
- 624
-
1Thanks. The only concern I have with this is that I's be sort of breaking the standard bootstrap hero unit structure which could be risky for a css amateur like myself. I could see myself screwing up alignments and such as the site evolves. – vt97john May 23 '13 at 21:37