Minimum and maximum padding and margin wanted

In What I Want From CSS3 - Part 1, Andy Budd notes that min-padding, max-padding, min-margin and max-margin would be very useful, especially for liquid layouts.

Yes indeed, that would be very useful. I suppose the properties Andy mentions would be the shorthand versions, so to specify the minimum amount of padding for an element you would write something like this:

  1. min-padding: 0em 1em 1em 2em;

And the corresponding longhand would be this:

  1. min-padding-top: 0em;
  2. min-padding-right: 1em;
  3. min-padding-bottom: 1em;
  4. min-padding-left: 2em;
  • October 27, 2005
  • Comments closed
  • Posted in

Comments

1. October 27, 2005 by Ara Pehlivanian

Forget min-padding. It would be nice for an implementation of min-height/max-height (in IE that is).

As for min-padding, yeah that'd be nice. :-)

2. October 27, 2005 by Steve Williams

Can't say I'm missing min/max padding?

gradient and drop-shadow selectors would get my vote, and help to trim a few unnecessary images from my sites!

Oh, and corner... Especially if it handled the border too!

corner:radius 1em; /*bliss*/

3. October 28, 2005 by

Background-image resizing. Borders defined by set of 8 images.

4. October 28, 2005 by Chris Heilmann

Could be a good idea, however wouldn't a proper min/max on an element with a percentual padding do the same?

5. October 28, 2005 by Lachlan Hunt

Actually, there are better ideas than introducing new properties for everything you'd want min/max variants for.

min(), max() and calc() functional notations have been suggested previously, with the idea being that you could specify something like:

margin: min(10%, 2em); padding: max(5%, 20px); width: calc(80% - 2em);

6. October 28, 2005 by Roger Johansson

Chris: Almost, but not quite. Read Andy's post - he explains the problem with percentages.

Lachlan: That seems like a good idea.

7. November 11, 2005 by YaaL

One thing I miss sometimes is defining whether the scrollbar should be inside or outside (so when I tell a box to be 500 pixels wide, it is 500 pixels wide, not 500±scrollbar, depending on browser's mood).

8. December 1, 2005 by oliver taylor

Yeah, this would be nice. I've often run into situations when min-margins would be useful.

Sorry, comments are closed for this post.

Information, sponsorship, and externals

About the author

Roger Johansson is a Swedish web professional specialising in web standards, accessibility, and usability. More about me and this site.

Subscribe

Looking for web hosting?

Try DreamHost!

Use the promo code 456BEREASTREET3 to save USD 20 when you sign up!

Latest articles

Validation statistics from Nikita the Spider Comments off
An analysis of the sites crawled by the bulk validation tool Nikita the Spider during March 2008.
Authentic Jobs API and Affiliates program Comments off
The Authentic Jobs job listing service now has a public API and an affiliate program.
What does Acid3 mean to you and me? Comments off
Opera and Apple have announced that their web browsers pass the Acid3 Browser Test, but how will that help web designers and developers?
Designing Web Navigation (Book review) Comments off
Learn the fundamentals of navigation design and design better navigation systems for large and small sites as well as for web based applications.
DOMAssistant bundle for TextMate Comments off
To save keystrokes and speed up development I have created a DOMAssistant bundle for TextMate.
First impressions of Internet Explorer 8 Beta 1 Comments off
My impressions after trying out Internet Explorer 8 Beta 1 for a couple of days.

More articles

Favourites, here and elsewhere

Affiliation

  • NetRelations
  • Kaffesnobben
  • Dagens recept
  • 9rules network member

Support this site

Show your support by buying a book or two from SitePoint or getting me something from my Amazon Wish List.