On 23 Jun 2003 17:39:00 +0200, Erik Moeller <erik_moeller(a)gmx.de> gave
utterance to the following:
tarquin-
I'd like to add some CSS classes to our
stylesheets, based on the
popular image layouts listed on this page:
http://www.wikipedia.org/wiki/Wikipedia%3AImage_markup_gallery
For example, instead of this:
------------
<div style="float:right;margin:0 0 1em 1em;">[[Image:image name|alt
text]]
''Caption''</div>
------------
we could write this:
---------------
<div class="floatright">[[Image:image name|alt text]]
Then would you have to write
<div class="floatright" style="width:300px;">
to get the pixel width? This is important for preventing the caption from
expanding the floating framge.
You would indeed, because any browsers which follow CSS1 or CSS2 rather
than CSS2.1 (the latter was only formalized in February this year) ought to
render a floated div of unspecified width as 100% wide rather than "shrink-
wrapping" it. If you float the image directly it will shrink-wrap, but then
there is no way to include the caption.
Do we have a database table of image details? If do, this ought to contain
height and width information, which would allow php to automatically insert
the width as it writes the image statement. (You would probably need to
write a perl script robot to work its way through the current image stock
generating such a table, and then modify the upload script to keep it up to
date for new images.)
What's with the 0 0 1em
1em anyway? margin:10px works fine.
That means Top and Right margins of zero, bottom and left of 1x the user's
line-height. A lack of right margin is more efficient and looks better
Regards,
Erik
_______________________________________________
Wikitech-l mailing list
Wikitech-l(a)wikipedia.org
http://mail.wikipedia.org/mailman/listinfo/wikitech-l
--
Richard Grevers
I'm easy to please as long as I get my way