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 trial
Tunde Adegoroye
20,597 PointsCss colour overlay on image issue
So i've been having a lot of issues with this all day i seem to be struggling with the text within the container. It's not centering here is the code.
2 Answers
Christian Andersson
8,712 PointsYou need to give your textblock´ class atext-align: center` property.
text-align: center;
This will align your text in the center. If it doesn't appear perfectly centered, it might be because your content div is wider than the image.
You may remove the text-align: center line on your .overlay:hover .textblock { selector. You don't need it.
Also, I hope you read my reply to your whitespace issue that you posted about earlier. I did put quite some effort in explaining it all in detail :)
Alan Johnson
7,625 PointsWe're you wanting something like this?
Tunde Adegoroye
20,597 PointsSort off but the text isn't disappearing you see
Tunde Adegoroye
20,597 PointsTunde Adegoroye
20,597 PointsSorry for not replying before mate was reading but i haven't done any html & css for a while so i've forgot a bit need to get back into the swing of things again but your advice was helpful :)