[ros-web] Re: Interface Team Co-ordinator: mf
Mark IJbema
mark at ijbema.xs4all.nl
Fri Jun 10 00:45:33 CEST 2005
On Thu, Jun 09, 2005 at 07:20:23PM +0200, mf wrote:
> I won't deny that you can do the same thing just as well with CSS, I
> only state there is nothing against using tables. The actual reason I've
> used tables for the main content div, is that my attempt at using CSS
> for it had IE throwing up its lunch over it. Problem here is the main
> content should be 20px offset from the left, 200px offset from the
> right, with any available width in between that in use. I probably don't
> correctly master all available workarounds for IE's bugs (though I have
> to say I think I know quite a few), and my only known workaround for
> this is using tables, since IE ignores display:table-cell; and such (I
> believe that's CSS2). I might have another shot at it later and try
> using padding and such icky things to get it to work, but don't get your
> hopes up.
You probably ran into the msie incorrect boxmodel. In msie the width of
an element is including the padding (incorrectly), and in compliant
browsers it's only the width of the element. So lets say you want an
element (say p) with a width of 200px, and padding of 20px on left and
right you might do it like this:
/* correct css: */
width:200px;
padding-left:20px;
padding-right:20px
/* msie hack, using underscore hack */
_width:240px;
for brievity i used the underscore hack, but feel free to check out
others. Personally i like to use conditional comments, since that's by
far the cleanest way. Also, i think it's rather stupid to still use
tables, and for many good reasons like accessibility (tables tend too
mess up the order, and don't scale well to small screens), changeability
(it's _way_ easier to only change the stylesheet, and leave all html
untouched).
You might want to check out site like A List Apart ( www.alistapart.com )
to find out what you can achieve with css.
Regards,
Mark
More information about the Ros-web
mailing list