?

Log in

No account? Create an account
"CSS is much too interesting and elegant to be not taken seriously." - Lindsey Kuper [entries|archive|friends|userinfo]
Lindsey Kuper

[ website | composition.al ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

"CSS is much too interesting and elegant to be not taken seriously." [Jun. 26th, 2006|05:03 pm]
Lindsey Kuper
[Tags|]

Sweet! John Walker, the guy who founded Autodesk, liked the feedback I sent him about tiled background image alignment.

Reader Lindsey observes that the "<span>" tag can be made to behave as a block-level element by adding a "display: block;" property to the style definition applied to the span. This works fine in Firefox, Opera, and Internet Explorer. Declaring the span to be a block-level element also causes the background to fill the box instead of appearing ragged right. I have added an example of such a declaration to the example document. Still, as Lindsey notes, it's better to apply the background style to an enclosing container which is a block-level element to begin with instead of forcing the browser to change the interpretation of an inline element to behave as a block. (2006-06-26 12:24 UTC)

All these years, and I still haven't gotten tired of CSS. You know how sometimes you make a decision and you know it was the right one because other, seemingly unrelated things fall into place? That's what I dig so much about CSS -- when you're doing it right, if one component is well-written, other things can't help but be well-written too. I suppose that it becomes this way with anything, once you get good enough at it -- but I wouldn't know.

LinkReply

Comments:
[User Picture]From: jes5199
2006-06-27 01:13 am (UTC)
i love and hate CSS. i always start to wish that i could have equations, like "width of element X is always twice the height of element FOO", like spreadsheet formulas for size values
(Reply) (Thread)
[User Picture]From: idealisms
2006-06-27 05:30 am (UTC)
I had started to write something for this a long time ago, but lost interest in it.

*shrug*
(Reply) (Parent) (Thread)
(Deleted comment)
[User Picture]From: dan_o_m
2006-07-12 05:02 am (UTC)
So...why is it better to apply block-type styles to enclosing block-level elements rather than force an inline element to act as a block? Higher likelihood of cross-browser compatibility?
(Reply) (Thread)
[User Picture]From: lindseykuper
2006-07-16 01:22 am (UTC)
To me it's just a matter of using the right tool for the job. Why try to change an inline element into something it's not, when the block-level element is available for you to use? Let the browser's default styles do some of the work for you.
(Reply) (Parent) (Thread)