body tags with ids

I had an neat “CSS” idea today that I’ve never actually seen anywhere: giving your <body> tag an ID or CLASS. Then, if you have a stylesheet that operates across your entire site, you can style the same element in different ways on different pages by setting up rules along the lines of:


  A.cdlink { color: red; }

  #compilationPage A.cdlink { color: green; }

Simple and effective, but strangely absent, as far as I can see, from all the CSS books I have …

Leave a Reply

Your email address will not be published. Required fields are marked *