obdurodon / dh_course

Digital Humanities course site
GNU General Public License v3.0
20 stars 6 forks source link

Using CSS in an XSLT Stylesheet #462

Closed charlietaylor98 closed 3 years ago

charlietaylor98 commented 4 years ago

As we discussed on Monday, you style your output html using CSS with the <style> element. However, whereas oxygen can check that everything in a .css document is proper CSS syntax, it doesn't do so in a .xsl document. For example, I had written <style> ul {backgroun-color: #eeac99; margin-left: 10px} </style> Note that I made a spelling mistake (as I often do) and omitted the "d" in "background". This means that when I generated the HTML, the background remained white. It took me a good minute to figure out why my styling didn't work, whereas in a CSS document I would have known automatically. (Plus, the generation of a lot of CSS rules makes a .xsl document harder to read, at least in my opinion.)

pickettj commented 4 years ago

Great point, @charlietaylor98 ! I only use the inline <style> element for demos and one-off exceptions.