This is probably a case of trying to run before I can walk, however… I have the following code:
<div class="hidden" id="repair_complete">
// some code
</div>
I was under the impression that if my CSS file contained:
#hidden {
display: none;
}
… then the div content wouldn’t display. However, it seems to only adopt this behaviour if the CSS file contains a reference to the div id:
#repair_complete {
display: none;
}
In a book I’m working through the opposite seems to be true – the style sheet refers to the class name, not the id.
Any ideas where I’m going wrong?!
Your CSS syntax is incorrect.
If you want to access this div, you can do it like this:
Note that to access an element by class you use a dot before the class name. You use a hash before the ID.