Re: Objection to HTMLWG ISSUE-144 Change Proposal #2 (keep u non-conforming)

Aryeh Gregor, Sun, 3 Apr 2011 13:51:07 -0400:
> On Fri, Apr 1, 2011 at 10:37 PM, Leif Halvard Silli wrote:
>> Aryeh Gregor wrote, on Fri, 1 Apr 2011 18:14:48 -0400
>> 
>>> That means <u>
>>> and <tt> should be; <blink> should not because it's not commonly
>>> wanted, and is arguably extremely unwanted; <font> and <center> and
>>> align= should not because they don't follow the CSS model.
>> 
>> How doesn't <center> "follow the CSS model"?

>[...] consider the following markup:
> 
> data:text/html,<!doctype html><center>
> <div style="height: 10em; width: 10em; background: blue"></div>
> <div style="height: 10em; width: 20em; background: red"></div>
> </center>
> 
> The <center> here cannot, as far as I know, be replaced by any <div>
> with inline style on the div alone that achieves the same results.

Actually, I believe it can easily be achieved with CSS:

data:text/html,<!DOCTYPE html><style>div.center{text-align:center}
div.center *{margin-left:auto;margin-right:auto;}</style>
<div class="center">a
 <div  style="height: 1em; width: 10em; background: blue">b</div>
 <div style="height: 1em; width: 20em; background: red" >c 
  <span style="display:inline-block;width:100px;background:yellow"
>d</span></div></div>

Above I only used divs. But you can change the first <div> into 
<center> and it will look the same. (Thre are no styles for <center> in 
the above example.)

> [...] That's why HTML
> defines <center>'s effect in terms of the non-CSS concept of "aligning
> descendants" that it makes up:
> 
> 
http://www.whatwg.org/specs/web-apps/current-work/multipage/rendering.html#align-descendants

I am not able to grok that particular paragraph that you link to there. 
But 4 paragraphs above, <center> - together with <caption>(!) - is 
mentioned and their CSS behaviour is described in clear, CSS terms:

]] The center element, the caption element unless specified otherwise 
below, and the div, thead, tbody, tfoot, tr, td, and th elements when 
they have an align attribute whose value is an ASCII case-insensitive 
match for either the string "center" or the string "middle", are 
expected to center text within themselves, as if they had their 
'text-align' property set to 'center' in a presentational hint, and to 
align descendants to the center. [[
-- 
leif halvard silli

Received on Sunday, 3 April 2011 20:52:37 UTC