Re: [whatwg] additional empty elements

2007-10-30 Thread Ian Hickson
On Tue, 1 May 2007, Brenton Strine wrote:
 
 Say, for example, you have a website which has sections of content that 
 are indented variously. It would be easy to accomplish the different 
 styles using classes:
 
 div class=firstgroupThis text isn't indented at all!/div
 div class=secondgroupThis text is indented a little./div
 div class=thirdgroupLots of indentation./div
 div class=firstgroupNo indentation here!/div

In general you should try to avoid using markup like this, which is tied 
to the presentation, and instead use markup that describes the meaning of 
the document, and have stylesheets keyed to that.


 However, if I then wanted to add additional special styling to the first 
 and third div, (e.g.. a border and background color) it is less 
 graceful. I could add style attributes, but that would be wasteful if I 
 want to do this on a large scale. Multiple classes would be confusing.

I don't see why multiple classes would be confusing.


 A nice solution would be the addition of a few div tags. (e.g. div2, 
 div3, div4 and div5.) Then you could do something like this:
 
 style
 div1 {text-indent:0px;}
 div2 {text-indent:10px;}
 div3 {text-indent:20px;}
 /style
 
 Then:
 
 div1This text isn't indented at all!/div1
 div2This text is indented a little./div2
 div3Lots of indentation./div3
 div1No indentation here!/div1
 
 This is much more human-readable, and the addition of additional styles 
 is now elegant and easy with the use of classes.
 
 div1 class=bluestyleThis text isn't indented at all!/div1
 div2This text is indented a little./div2
 div3 class=redstyleLots of indentation./div3
 div1No indentation here!/div1

I'm not sure I agree that this is more elegant.


 I also think that it would simply be easier to write code if there were 
 a few extra non-semantic empty tags. HTML5 needs improvements that will 
 make people want to use it. Making it easier to code than HTML 4 will 
 ensure a quicker and wider acceptance.

The goal isn't wide acceptance, the goal is a higher quality language.


 I am okay with the unimaginative numbering of the extra elements, as it 
 would make it easy to have a lot of new elements. However, there are 
 countless possibilities: section, chunk, partition, block, 
 enclosure, zone, figure, sector, quadrant etc...

Well, we have section amd figure now, for sections and figures 
respectively.


 Are there other people who have found themselves wishing for another 
 span or div-like tag?

Apparently not. :-)


On Tue, 1 May 2007, Alexey Feldgendler wrote:
 
 HTML is a language for markup meaningful by itself, not just as a hook 
 for CSS. div2 doesn't mean anything.

Indeed.


On Tue, 1 May 2007, Jon Barnett wrote:

 If you're marking up stuff as a tree, the markup should probably look like a
 tree:
 section id=treeFirst group
 divSecond Group
 divThird Group/div
 /div
 /section
 
 if what you want it a tree, that structure is better, so the CSS would
 simply say:
 #tree, #tree div { margin-left: 5em; }
 
 If you want to style each level differently, that's still easy to do without
 making up class names:
 #tree { background: blue; }
 #tree  div { background: green; }
 #tree  div  div { background: yellow; }

Indeed. One could also use nested uls for a tree.


On Tue, 1 May 2007, Brenton Strine wrote:
 
 That doesn't seem very practical to me. If all HTML tags imply some 
 meaning, then you are advocating the elimination of presentation, not 
 it's separation. If there weren't any CSS hooks, wouldn't people just 
 (incorrectly) use other tags, like h1? I think that CSS and HTML are 
 unbreakably connected.

You can hook CSS to the meaning, it doesn't have to be an explicit hook. 
For example, you can style your headings:

   h1 { color: blue; }

...and the first paragraph after a heading:

   h1 + p { text-indent: 2em; }

...and so on.


On Tue, 1 May 2007, Dan Dorman wrote:
 
 An HTML document ought to make semantic sense, without regard to 
 presentational information.  The very definition of the separation of 
 presentation from content is that the content should be authored without 
 regard to how it will appear.  That's not to say presentation is being 
 eliminated, however; presentation simply should not be a consideration 
 in how the content is authored.  Ideally, anyway.

Indeed.


 Indeed, one could say CSS is fundamentally dependent on HTML; the 
 reverse is not true.  Imagine a new technology came along to make HTML 
 pretty:  wouldn't it be nice if you didn't have to rewrite the HTML to 
 service this new technology?

Indeed,


 As to folks using incorrect tags, well, what you're proposing isn't 
 going to fix that.

Sadly true.


 I think the supposition that multiple class names are confusing is 
 flawed.  What's wrong with saying div class=redtext indentmore 
 (besides the fact that you'd want more useful, informative class names 
 than redtext and indentmore)?  By looking at it, someone could 
 readily tell it's got the properties of both redtext 

Re: [whatwg] additional empty elements

2007-05-02 Thread Geoffrey Sneddon


On 1 May 2007, at 20:21, Brenton Strine wrote:


However, if I then wanted to add additional special
styling to the first and third div, (e.g.. a border and
background color) it is less graceful. I could add style
attributes, but that would be wasteful if I want to do
this on a large scale. Multiple classes would be
confusing.

A nice solution would be the addition of a few div tags.
(e.g. div2, div3, div4 and div5.) Then you could
do something like this:

style
div1 {text-indent:0px;}
div2 {text-indent:10px;}
div3 {text-indent:20px;}
/style


Why not:

!DOCTYPE html
style
.first {
color: red;
}
.first + div {
text-indent: 10px;
}
.first + div + div {
text-indent: 20px;
color: blue;
}
/style
div class=firstIndent 0/div
divIndent 1/div
divIndent 2/div
div class=firstIndent 0/div
divIndent 1/div
divIndent 2/div




[whatwg] additional empty elements

2007-05-01 Thread Brenton Strine
I would like to know what other people think about
creating more empty elements in HTML5.

Say, for example, you have a website which has sections
of content that are indented variously. It would be easy
to accomplish the different styles using classes:

div class=firstgroupThis text isn't indented at
all!/div
div class=secondgroupThis text is indented a
little./div
div class=thirdgroupLots of
indentation./div
div class=firstgroupNo indentation here!/div

However, if I then wanted to add additional special
styling to the first and third div, (e.g.. a border and
background color) it is less graceful. I could add style
attributes, but that would be wasteful if I want to do
this on a large scale. Multiple classes would be
confusing. 

A nice solution would be the addition of a few div tags.
(e.g. div2, div3, div4 and div5.) Then you could
do something like this:

style
div1 {text-indent:0px;}
div2 {text-indent:10px;}
div3 {text-indent:20px;}
/style

Then:

div1This text isn't indented at all!/div1
div2This text is indented a little./div2
div3Lots of indentation./div3
div1No indentation here!/div1

This is much more human-readable, and the addition of
additional styles is now elegant and easy with the use of
classes.

div1 class=bluestyleThis text isn't indented at
all!/div1
div2This text is indented a little./div2
div3 class=redstyleLots of
indentation./div3
div1No indentation here!/div1

 I also think that it would simply be easier to write
code if there were a few extra non-semantic empty tags.
HTML5 needs improvements that will make people want to
use it. Making it easier to code than HTML 4 will ensure
a quicker and wider acceptance.

I am okay with the unimaginative numbering of the extra
elements, as it would make it easy to have a lot of new
elements. However, there are countless possibilities:
section, chunk, partition, block, enclosure,
zone, figure, sector, quadrant etc...

Are there other people who have found themselves wishing
for another span or div-like tag?


Brenton Strine


Re: [whatwg] additional empty elements

2007-05-01 Thread Alexey Feldgendler
On Tue, 01 May 2007 21:21:20 +0200, Brenton Strine  
[EMAIL PROTECTED] wrote:



A nice solution would be the addition of a few div tags.
(e.g. div2, div3, div4 and div5.) Then you could
do something like this:


HTML is a language for markup meaningful by itself, not just as a hook for  
CSS. div2 doesn't mean anything.



I am okay with the unimaginative numbering of the extra
elements, as it would make it easy to have a lot of new
elements. However, there are countless possibilities:
section, chunk, partition, block, enclosure,
zone, figure, sector, quadrant etc...


This is something that WHATWG is already doing (section, footer etc),  
basing on the popularity of certain classnames found in the wild.



--
Alexey Feldgendler [EMAIL PROTECTED]
[ICQ: 115226275] http://feldgendler.livejournal.com


Re: [whatwg] additional empty elements

2007-05-01 Thread Jon Barnett

If you're marking up stuff as a tree, the markup should probably look like a
tree:
section id=treeFirst group
divSecond Group
divThird Group/div
/div
/section

if what you want it a tree, that structure is better, so the CSS would
simply say:
#tree, #tree div { margin-left: 5em; }

If you want to style each level differently, that's still easy to do without
making up class names:
#tree { background: blue; }
#tree  div { background: green; }
#tree  div  div { background: yellow; }

Child selectors are not supported by IE6, but I believe they are by IE7 and
every other browser.


Re: [whatwg] additional empty elements

2007-05-01 Thread Brenton Strine
 HTML is a language for markup meaningful by itself, not
just as a hook for CSS. 
 div2doesn't mean anything.

That doesn't seem very practical to me. If all HTML tags
imply some meaning, then you are advocating the
elimination of presentation, not it's separation. If
there weren't any CSS hooks, wouldn't people just
(incorrectly) use other tags, like h1? I think that CSS
and HTML are unbreakably connected. 

Brenton


Re: [whatwg] additional empty elements

2007-05-01 Thread Dan Dorman

On 5/1/07, Brenton Strine [EMAIL PROTECTED] wrote:

If all HTML tags
imply some meaning, then you are advocating the
elimination of presentation, not it's separation.


An HTML document ought to make semantic sense, without regard to
presentational information.  The very definition of the separation of
presentation from content is that the content should be authored
without regard to how it will appear.  That's not to say presentation
is being eliminated, however; presentation simply should not be a
consideration in how the content is authored.  Ideally, anyway.


If there weren't any CSS hooks, wouldn't people just
(incorrectly) use other tags, like h1? I think that CSS
and HTML are unbreakably connected.


Indeed, one could say CSS is fundamentally dependent on HTML; the
reverse is not true.  Imagine a new technology came along to make HTML
pretty:  wouldn't it be nice if you didn't have to rewrite the HTML to
service this new technology?

As to folks using incorrect tags, well, what you're proposing isn't
going to fix that.

I think the supposition that multiple class names are confusing is
flawed.  What's wrong with saying div class=redtext indentmore
(besides the fact that you'd want more useful, informative class names
than redtext and indentmore)?  By looking at it, someone could
readily tell it's got the properties of both redtext and
indentmore.  In my estimation, being able to combine classes is one
of the more powerful aspects of CSS.

Dan Dorman