Reply to Re: Using percentage widths

Your name:

Reply:


Posted by dorayme on 12/22/06 01:50

In article <slrneom348.bl7.spamspam@bowser.marioworld>,
Ben C <spamspam@spam.eggs> wrote:

> >> #three
> >> {
> >> left: 66%;
> >> right: 0;
> >> background-color: blue;
> >> }
> >> </style>
> >
> > Why the two dimensions, left and right? Would not left be good
> > enough, at least for #one and #two?
>
> Not unless you also set width. If you set two out of the three (left,
> width and right) the browser solves for the other one.
>
> Another quite useful thing about using left and right rather than width
> is they're measured to the outside of the marginpaddingborders. So in
> this example, if you just add to the div selector at the top:
>
> border: 10px solid black;
> margin: 2em;
>
> All the divs get the border and margin and still spread evenly across
> the page. This is hard to do with percentage-width floats, because you
> can't say "33% - 10px" (and even if you could it would be annoying to
> have to), so you have to guess, or nest divs with the borders and
> margins inside the three undecorated 33%-wide floats.

Good, armed with this, I might have a go at making my next three
column website with absolute just so I have one in my stable.

--
dorayme

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация