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

CSS

Div Color Problem

I have a div with a grey background color, but after I made the div a link to another page the background color disappeared. I tried with text-decoration: none but it is not working. what do yo think the problem may be ? Thanks for your time.

This is the div in the HTML file

'''<a href="de.html"> <div id="gra" class="sections">

                        <h2>Graphic Desings</h2>
                    </div>

</a>'''

On the CSS

''' a {

text-decoration: none;

} '''

4 Answers

It's better if you post the code your having a problem with then people can help you with your issue

There is nothing wrong with the code that is why I did not posted. I find my problem odd because it is not supposed to happen.

Set the a{ background-color: #yourcolor;}

Also to add, are you trying to just make the h2 tags a link or the whole div that the h2 tags are in ?

the whole div