Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Floatation Devices...
- John Perrier II
December 8, 2004, 1:18 am
rate this thread
I am a budding HTML operator, with only a small portfolio of experience to
draw from. I am still at the learning stage, trying out "pretend websites"
on my own computer.
I have two very simple questions that I am hoping to elicit some form of
Here is the first: I am learning to use CSS more for positioning than table
cells, as is the current trend in progressive thinking. For some of my
design attempts, I still use a single-celled table containing a picture and
descriptive text beside it. I position the picture with either a
"float-right" or "float-left" style defined in CSS. The descriptive text
lies beside it; I usually apply a font-style css to the <td> of the cell to
govern the "look" of the font. But one problem I have is is for, say larger
pictures accompanied by smaller blocks of text: no matter how I tweak with
the style dialogue box (dw/mx), I can't find an attribute that will position
the block of text in the vertical centre of the "left-floated" or
"right-floated" picture. The text always drifts to align with the top of
the graphic, leaving a disproportionate amount of empty space below.
I'm sure this problem would persist even if I dropped the table cell and
floated content relative to the empty page. Can anyone suggest a tweak for
buttons that DW generates, it tends to stop animated gif's that I use from
playing. Has anyone else encountered this anomaly before?
Thank you kindly for any input you can offer.
- Jeffrey Silverman
December 8, 2004, 1:49 am
Re: Floatation Devices...
not really an answer, but...
why do you bother with the table cell at all if you are using div's inside
it to position content?
It seems to me as iff it will just create tag soup.
Also, does your page validate?
** Drop "PANTS" to reply by email
Re: Floatation Devices...
Why? Use a div instead, less markup, more sensible. Or even a p element
with an image within. That might even be better.
Don't use the table element unless it's really a table, where the content
is compared in some way by column and row.
Yep. That's how float is supposed to work.
There's few reliable ways that are supported on all browsers. One thing
you can try is setting a top margin in pixels to the text. (But not to the
markup containing the image!) Depending on the text, a little less than
half the height of the image will do. It won't lock it in perfectly, but
it will make better use of the space. Perhaps someone else knows of a way
to do it better.
Though you may want to consider if this is the best way to accomplish what
you're doing. Consider other layout choices - not that what you want is
bad, but other ways are certainly easier and more predictable, and if one
of them serves your ends in pretty much the same way, why not go with it?
I don't use DW, animated GIFs, or JS mouseover stuff. Again - do you
really need it? Can't CSS do the work?