Thank you so much for your answers, Ryan and Paul!
Hasty me, I despairingly lost hope that anyone would answer after 24 hours, so I just stopped looking at my code for a couple of weeks. Today I decided to check on here again and thankfully I did! I'm now inspired to go back to my code and finish the site I was working on. Thanks so much guys for all your help!
Paul, thanks for the code. It is working perfectly now! I also asked this on stack overflow, so if you have an account there, you can paste your answer there and I'll select it as the best answer; otherwise, I'll paste your answer there linking over here to credit you.
Besides learning this CSS bit, I also learned the lesson that next time I shouldn't be so hasty!
Thanks again for all your help guys!