[thelist] right-align with right-edge padding

John DeStefano john.destefano at gmail.com
Tue Mar 7 09:32:14 CST 2006


Thanks to all for the syntax help, and to Ben and Chris for getting me
to "think outside the box-model".  The trick seems to be in
"cascading" the styles as Ben describes below:

> A few things to consider:
>
> don't use commas in your css - padding: 0px 30px 0px 0px;
>
> if your using width:100% and padding-right:30px this will add upto
> 100% + 30px due to the box-model.
>
> The Box model also depends on browsers/doctypes etc and is worth
> avoiding adding padding/widths to the same element if possible. Better
> solution would be to use the cascade.
>
> #BannerMain {
>       background-color: #BD0000;
>       color: White;
>       width: 100%;
>       font-weight: bold;
>       font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
> }
>
> #BannerMain p { padding-right:30px;text-align: right;}
>
> Ben.
>

Works perfectly for me.

Thank you!
~John



More information about the thelist mailing list