Forum Moderators: not2easy

Message Too Old, No Replies

absolute positioning in IE

doesnt work as expected

         

benihana

12:30 pm on Jul 4, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Im trying to use absolute positioning to move a tables caption away fromthe main body of the table.

Its for a variety of reports, and structurally/semantically the caption is fine, but visually it should be at the top of the page like a title.

The container div has position:relative; so using pos:abs on the caption should position it in relation to that, and it does. except for ie. :(

Any ideas?

ta

ben

RedAndy

10:04 am on Jul 5, 2006 (gmt 0)

10+ Year Member



Hi,

I guess IE might be positioning the absolute box in reference to the normal flow position of the containing element, rather than it's adjusted relative position.

Can you use either the Tan Hack:

* html yourElement { blah: blah; }

or a conditional:
<!--[if IE]> 
yourElement { blah: blah; }
<![endif]-->

to get around it?

hth

Andy

benihana

10:19 am on Jul 5, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



yes - its positioning it in relation to its parent (the table) when it should be in relation to its nearest parent that has specified positioning (the #content div).

Conditionals dont help, as there is no additional css i can put in that seems to chnage its behaviour.

However, im considering adjusting the layout, so it maybe a moot point.

cheers

RedAndy

5:50 am on Jul 6, 2006 (gmt 0)

10+ Year Member



Can you use the conditional to add padding/margin/border or whatever moves the caption to where you want it in IE?

benihana

9:05 am on Jul 6, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



nope.

Robin_reala

11:03 am on Jul 6, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



IE has difficulty in applying certain styles to table captions. For example, you can't do text-align:justify on them. Maybe this is just another style you can't apply to them? I've not come up against it before though.

benihana

11:10 am on Jul 6, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



yeah that seems to be the case robin_reala :(

Ack! im not the sort to worry about minor browser differences, but this really is a big deal - ill have to amend my page :(