Brilliant! Thanks for spotting that for me. I did look for syntax errors - it was the first thing that I thought of - but couldn’t see any. Originally there was an opacity factor of 0.4 in the background color, following the 207. I then decided to remove the opacity element but I didn’t know that in such an event, the comma had to be removed as well. So now I do! Thanks also for the Validator tip - I’ll be using it from hereon.
So now I can see the box but it’s not the square (500 X 500) that I have coded for.
The height takes up the entire length of the browser window. So what is the issue here ?
If you want the target the divs with classes, need to specify .top .bottom, and so on in your CSS rules. That will override the div style rule. If you want all three boxes to have the same size, you can give each of those divs the same class name and target them all at once in CSS. If you want them to have different sizes, then the way you have it, each one with a separate class, is fine. Or you can use id for that, too.
Thanks - that does clarify things but I do have a remaining question. The way I have my code is - parent div contains 3 child divs. So now I know that my CSS targets all the divs which leaves me wondering does the parent div get a
(500 X 500) box of its own as well as the 3 child divs?
Yes. What I think is happening is your parent div has a width and height of 500px. Since the child divs are the same size, they are overflowing underneath the parent div.
If you give your child divs a single class name and use your same CSS, you’ll get three boxes stacked on top of eachother. The parent div’s height now stretches to fit the child divs.
Thanks for your help with all this. Just to make certain I know what is going on here - you are telling me that we have the 3 child divs stacked atop each other and the parent div now has a height=1500 but is hiding behind the 3 child divs.which are in the foreground. Have I got that right?
“hit me in the head !” - of course - would you believe that I did know that
class is . and id is # ? OK so now with that embarrasment out of the way, I do see the red border so what am I to make of the situation? As I see it - I am guessing that I have 4 divs (1 parent 3 child) that are all (500 X 500) and the topmost child is behind the parent? Have I got that interpretation right?
Is that what the border you placed around the parent div is telling you? If the border isn’t helping you enough then change the color of the first child div and see which color shows up at the top.