Tom Gilder: "I did this in HTML, how do I do it in CSS?". A collection of tips for replicating visual formatting effects in old-style HTML with their CSS equivalents. A good resource for people just getting started with CSS. [Simon Willison's Weblog]
Like so many examples of how to do things with style rather than (say) tables there is a requirement to specify widths on things; its the thing one doesn't know, the width of the text. So, you end up specifying a suitably (you hope) large value in em units. Your layout then goes phut if you add some more text that doesn't fit within the styled width - the style definition is dependent upon the content which is (surely) wrong. Style values can/should only be dependent upon content when the style is set via script.
posted at: 9:30:47 AM
|