[thelist] css percentages

Kae Verens kverens at contactjuggling.org
Tue Feb 25 05:07:02 CST 2003


Anthony Johnston - Antix wrote:
> With the standards on boxes as they are I cannot get a flush
> 100% width bordered div - is this right?
>
> <div style='width: 100%;' border: solid 10px;>lalala</div>
> will make the screen scroll.
>
> is there a work around... about? TA, Ant.

I think the problem here is the border - first off, you've set it
outside the style definition, which is incorrect, but also when you
specify a width, the border is added to that width - so a box with width
100% and borders 2px is actually 100%+4px in size (not counting margins).

By default, <div> is display:block, which is 100% width - you don't need
to specify it as 100% width.

Try removing the padding and margin from <body>, which may help with
what you want.

btw: even if the border had been in the <div>, it wouldn't have worked
as you didn't define a colour. By default, the colour of the border is
transparent.

--
Kae Verens               _______\_   webworks.ie
pay:  www.webworks.ie       _____\\__   webhosts
play: www.contactjuggling.org  ___\\\___  design
  kae: kverens.contactjuggling.org _\\\\____ code




More information about the thelist mailing list