W3C home > Mailing lists > Public > www-style@w3.org > January 2012

Re: % is not a valid unit for border-width

From: Gérard Talbot <www-style@gtalbot.org>
Date: Thu, 5 Jan 2012 15:39:30 -0800
Message-ID: <7ea5ed4661d4ee60b40a9c697a01c708.squirrel@gtalbot.org>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: "W3C www-style mailing list" <www-style@w3.org>

Le Jeu 5 janvier 2012 13:56, Tab Atkins Jr. a écrit :
> 2012/1/5 "Gérard Talbot" <www-style@gtalbot.org>:
>> Le Jeu 5 janvier 2012 12:24, Tab Atkins Jr. a écrit :
>>>  A reasonable constructed
>>> example with an explanation of how percentage border widths would help
>>> will suffice.
>>> ~TJ
>> CSS Border Design Challenge
>> http://ago.tanfa.co.uk/css/borders/
>> With a percentage unit for border, I believe there would have been more
>> creative possibilities.
> Most of those are absolutely silly and not something we should
> actually care about,


Personally, I have not taken position for or against percentage unit for
border-width. If percentage unit for border-width becomes or does not
become a reality in a CSS3 module, it would make no difference to me. I
really do not care one way or another on this issue.

> but the keyboard design is at least *slightly*
> plausible and would benefit from percentage borders.  Still, though,
> I'd like to see an actual page using a scalable design that would
> benefit from it.

Your question is excellent because it relates to relevance, usefulness, etc..

Here's a real possibility where it would or could have made some  difference.


If percentage unit for border-width would be real, implemented, then at
line 98 of that page I would have coded something like this:

  background-color: #DDD;
  border: black solid 0.5%;
  color: #333;
  height: 99%;
  min-height: 440px;
  overflow: hidden;

In the code, I say and approximate 4px to be 1%:

  background-color: #DDD;
  border: 2px solid;
  color: #333;
  height: 99%; /* 99% since we use a total of 4px for top and bottom
borders */
  min-height: 440px;
  overflow: hidden;

When you're trying to do a scalable, as most scalable, fluid as possible,
then, understandably you want to use em unit everywhere possible or % unit
on every possible elements and properties which imply a dimension, a

(Disclaimer: a few weeks ago, I modified that webpage and probably forgot
to undo my changes; now, the page footer is off the screen... but before,
everything was inside the viewport.)

regards, Gérard
CSS 2.1 Test suite RC6, March 23rd 2011

Contributions to CSS 2.1 test suite

Web authors' contributions to CSS 2.1 test suite
Received on Thursday, 5 January 2012 23:40:00 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:09 UTC