Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

35 lines
1.3KB

  1. Extracting inline CSS from HTML Purifier
  2. voodoofied: Assigning semantics to elements
  3. Sander Tekelenburg brought to my attention the poor programming style of
  4. inline CSS in HTML documents. In an ideal world, we wouldn't be using inline
  5. CSS at all: everything would be assigned using semantic class attributes
  6. from an external stylesheet.
  7. With ExtractStyleBlocks and CSSTidy, this is now possible (when allowed, users
  8. can specify a style element which gets extracted from the user-submitted HTML, which
  9. the application can place in the head of the HTML document). But there still
  10. is the issue of inline CSS that refuses to go away.
  11. The basic idea behind this feature is assign every element a unique identifier,
  12. and then move all of the CSS data to a style-sheet. This HTML:
  13. <div style="text-align:center">Big <span style="color:red;">things</span>!</div>
  14. into
  15. <div id="hp-12345">Big <span id="hp-12346">things</span>!</div>
  16. and a stylesheet that is:
  17. #hp-12345 {text-align:center;}
  18. #hp-12346 {color:red;}
  19. Beyond that, HTML Purifier can magically merge common CSS values together,
  20. and a whole manner of other heuristic things. HTML Purifier should also
  21. make it easy for an admin to re-style the HTML semantically. Speed is not
  22. an issue. Also, better WYSIWYG editors are needed.
  23. vim: et sw=4 sts=4