L
liketofindoutwhy
A simple layout is attempted in CSS but can't be made into practice...
The result desired is displayed on:
http://www.0011.com/layout/want_to.html
(it is validated as HTML 4.01 Strict)
but that is done using a table. I don't want to use a table because i
think for some browsers, if there are 100 rows... then the table won't
be rendered until all 100 rows of images have been detected for the
width and height... the page may be empty until all 100 images are
loaded. (that might be for some older browsers). Nevertheless, I want
to try using span or div to do it.
A big issue is that I don't know the size of the image in advance (it
can be any image in the database).
so I tried just using a div with "vertical-align: middle" and it
doesn't work, as in
http://www.0011.com/layout/try1.html
and then "line-height:100%" using a span and it doesn't work, as in
http://www.0011.com/layout/try2.html
and also floating the 2 div left and right, and with the right hand
side "height:1em;margin:auto 0" just like centering a div
horizontally and won't work.
http://www.0011.com/layout/try3.html
i tried height: 100% and vertical-align: middle and even the the
height: 100% won't work, as indicated by the dashed border.
http://www.0011.com/layout/try4.html
again, the image on the left is unknown for the size as it is an image
from the database. Does somebody know how to make it happen without
using a table and without using javascript to get the size of the
image? thanks very much!
The result desired is displayed on:
http://www.0011.com/layout/want_to.html
(it is validated as HTML 4.01 Strict)
but that is done using a table. I don't want to use a table because i
think for some browsers, if there are 100 rows... then the table won't
be rendered until all 100 rows of images have been detected for the
width and height... the page may be empty until all 100 images are
loaded. (that might be for some older browsers). Nevertheless, I want
to try using span or div to do it.
A big issue is that I don't know the size of the image in advance (it
can be any image in the database).
so I tried just using a div with "vertical-align: middle" and it
doesn't work, as in
http://www.0011.com/layout/try1.html
and then "line-height:100%" using a span and it doesn't work, as in
http://www.0011.com/layout/try2.html
and also floating the 2 div left and right, and with the right hand
side "height:1em;margin:auto 0" just like centering a div
horizontally and won't work.
http://www.0011.com/layout/try3.html
i tried height: 100% and vertical-align: middle and even the the
height: 100% won't work, as indicated by the dashed border.
http://www.0011.com/layout/try4.html
again, the image on the left is unknown for the size as it is an image
from the database. Does somebody know how to make it happen without
using a table and without using javascript to get the size of the
image? thanks very much!