generated-content

How to access CSS generated content with JavaScript

I generate the numbering of my headers and figures with CSS's counter and content properties: img.figure:after { counter-increment: figure; content: "Fig. " counter(section) "." counter(figure); } This (appropriate browser assumed) gives a nice labelling "Fig. 1.1", "Fig. 1.2" and so on following any image. Question: How can I ac...

Scaling generated content in CSS.

How do you scale an image added in :before or :after in CSS? For example, I have a page which contains a book cover: <span class="book"> <img src="http://ecx.images-amazon.com/images/I/41t7xMPK%2B6L.jpg" /> </span> I want to use CSS to make it look more like a book, rather than just a cover. I can use :before to add a second ima...