View Single Post
Old Mar 15th, 2013, 10:02 PM   #2
SteveO
Hobby Programmer
 
SteveO's Avatar
 
Join Date: Nov 2010
Location: Texas
Posts: 693
Rep Power: 8 SteveO is on a distinguished road
Re: Is empty div tags a bad practice?

You could write the stylesheet like so:

CSS Syntax (Toggle Plain Text)
  1. body {
  2. /* Other styles here */
  3. background-color: #f5f5f5;
  4. }

You can then attach the stylesheet like so:

HTML Syntax (Toggle Plain Text)
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <!-- Whatever you need here, including script and meta tags -->
  5.  
  6. <!-- Attach stylesheet -->
  7. <link rel="stylesheet" type="text/css" ref="/path/to/file/style.css">
  8. </head>
  9. <body>
  10. <!-- Content goes here -->
  11. </body>
  12. </html>

It's never really a good idea to leave stuff that is useless in a web page.
__________________
"I have no special talent. I am only passionately curious."
SteveO is offline   Reply With Quote