We Recommend

CSS: The Definitive Guide CSS: The Definitive Guide
Provides you with a comprehensive guide to CSS implementation, along with a thorough review of all aspects of CSS 2.1. Updated to cover Internet Explorer 7, Microsoft's vastly improved browser, this new edition includes content on positioning, text wrapping (nowrap), lists and generated content, table layout, user interface, paged media, and more.


Posted By

j_junyent on 11/25/07


Tagged

deprecated code


Versions (?)


Who likes this?

3 people have marked this snippet as a favorite

jonhenshaw
SpinZ
heinz1959


Disablig deprecated HTML code


Published in: CSS 


URL: http://monc.se/kitchen/140/disabling-deprecated-html-using-css

When handing over a project to the client, you sometimes loose control over the content HTML source. Sometimes the client uses a CMS that allows them to have full control over certain parts of the HTML, and sometimes the client simply uses your templates to insert their own HTML content in the document. The idea is to preserve the natural cascade and inheritance in all browsers, while gracefully disabling the HTML we don’t want the client to use. That way the client will stop using it, simply because it doesn’t “work” anymore. A graceful and gentle way of guiding the client in the right direction.

  1. font,basefont {
  2. color:inherit; /* Standard browsers */
  3. color:expression(this.parentNode.currentStyle['color']); /* IE */
  4. font:inherit; /* Standard browsers. Font instead of font-size for Opera */
  5. font-family:expression(this.parentNode.currentStyle['fontFamily']); /* IE */
  6. font-size:100%; /* All browsers. Sizes are inherited */
  7. }
  8. center {
  9. text-align:inherit; /* Standard browsers */
  10. text-align:expression(this.parentNode.currentStyle['textAlign']); /* IE */
  11. }
  12. s,strike,u {
  13. text-decoration:inherit; /* Standard browsers */
  14. text-decoration:expression(this.parentNode.currentStyle['textDecoration']); /* IE */
  15. }
  16. *[align] { text-align:inherit; } /* Standard browsers */
  17. * { text-align:expression(this.align ? this.parentNode.currentStyle['textAlign'] : ''); } /* IE */
  18. img { margin:0; border:none; } /* All browsers. Borders & margins are not inherited */
  19. ol { list-style-type:decimal; } /* All browsers. Removes the type attribute */
  20. body { background-color:transparent; /* All browsers */ }
  21. table,tr,th,td {
  22. width:auto; /* All browsers */
  23. height:auto; /* All browsers */
  24. background-color:transparent; /* All browsers */
  25. vertical-align:inherit; /* All browsers (works in IE) */
  26. border:none; /* All browsers. Borders are not inherited */
  27. }

Report this snippet 

You need to login to post a comment.