Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialKayla Pasciullo
Front End Web Development Techdegree Student 8,325 Pointsbackground image opacity not working properly at the bottom of my page?? PLS HELP :)
I am trying to make my background image lighter, its not working properly at the bottom of the page..
not sure if its an issue with the body / footer is not taking up the whole page
or if its an issue with this code
#backgroundimage::before{
margin: 0px;
padding: 0px;
content: "";
position: absolute;
top: 0px;
right: 0px;
left: 0px;
bottom: 0px;
background-image: url(domenico-loia-hGV2TfOh0ns-unsplash.jpg);
background-size: cover;
background-position: top center;
background-repeat: no-repeat;
opacity: 0.75;
}
ive also added this
body html{
height: 100%;
}
but its not helping?
https://kaylapasciullo.com/index.html https://kaylapasciullo.com/contact.html
ive been trying to troubleshoot this for way to long! please help me out here :) thanks so much!! kayla
Mod edit: added markdown syntax for code readability. Check out the "markdown cheatsheet" linked below the comment box for syntax examples.
1 Answer
Cameron Childres
11,820 PointsHi Kayla,
It looks like your background image is applied twice, once in your CSS and once as an inline-style in your HTML:
<div id="backgroundimage" style="background-image:url('domenico-loia-hGV2TfOh0ns-unsplash.jpg');">
#backgroundimage::before {
margin: 0px;
padding: 0px;
content: "";
position: absolute;
top: 0px;
right: 0px;
left: 0px;
bottom: 0px;
background-image: url(domenico-loia-hGV2TfOh0ns-unsplash.jpg);
background-size: cover;
background-position: top center;
background-repeat: no-repeat;
opacity: 0.75;
}
Try removing the inline-style (leaving your pseudo-element alone) and see if this gives the results you're after.
Kayla Pasciullo
Front End Web Development Techdegree Student 8,325 PointsKayla Pasciullo
Front End Web Development Techdegree Student 8,325 Pointsyes!!! that totally worked!! thank you SO much!!
would you happen to have any idea why now its giving me white space on small screens?