February 7, 201313 yr Learning CSS and Im stuck! please help, below is the question I have been asked: topic: Multiple Selectors On the CSS tab, select only the h3 header nested inside three <div>s and change itscolor to red. this is what my HTML looks like <!DOCTYPE html> <html> <head> <link type="text/css" rel="stylesheet" href="stylesheet.css"/> <title>Result</title> </head> <body> <h3>I'm plain old font!</h3> <div> <h3>Me, too!</h3> <div> <h3>Me three!</h3> <div> <h3>Forget you guys. I'm about to be red!</h3> </div> </div> </div> </body> </html> In regards to the question I dont know how to write this in the CSS tab, please help!
February 7, 201313 yr Author Create another div to match the h3 style with color red Lol your'e on youngwebbuilder.com arent you
February 7, 201313 yr Either give it an ID like this... <h3 id="h3header">Forget you guys. I'm about to be red!</h3> And then select it in the CSS like this... h3#h3header { color: red; } OR it may be better to just select like this (this is the method that I think they are asking for although not necessarily the best in real practice as it can be confusing). body div div div h3 { color: red; } This way you won't have to change any of your HTML. Edited February 7, 201313 yr by Alluziion
February 9, 201313 yr Agree with Alluziion ... If you can give it a class... assign a CSS value. If you can't touch the HTML... then drill down with the CSS. You MIGHT need to use "child and sibling" selectors though.More info about these can be found here: http://css-tricks.com/child-and-sibling-selectors/
Create an account or sign in to comment