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
Kenneth Thomas
Front End Web Development Techdegree Student 7,891 PointsHow can I blur the background of an <h2> element?
I have an image with a <h2> stacked on top of it. The background of the <h2> is transparent and is set to (0, 0, 0, .5). I would like the to blur the portion of the image that is directly behind the textbox but when I use filter:blur(5px) it blurs both the text and the background of the element opposed to just the background. What can i do?Looking to blur only the background of an <h2> element.
1 Answer
Steven Parker
243,318 PointsI wasn't able to reproduce your original situation, as when I place a heading with a transparent background over an image and blurred the heading, it did not also blur the image.
But by placing another layer in between in image and heading that was the same size as the heading and displaying a portion of that same image, and blurring that instead, I achieved the effect of blurring that portion of the background but not the heading text.
If you need more specific help, be sure to show your code (both HTML and CSS).