Re: [css-d] Use of empty DIVs?

2010-07-12 Thread Chris F.A. Johnson
On Mon, 12 Jul 2010, Val Dobson wrote:

> I use "Find and Replace".  What do you use?

   I don't use anything because I don't use names that are
   presentation related. Presentation belongs in CSS not HTML.

> On 11 July 2010 22:00, Chris F.A. Johnson  wrote:
> 
> >   #leftcol is not a good name. What if the design changes later and
> >   that column is on the right?

-- 
   Chris F.A. Johnson, 
   Author:
   Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)
   Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)__
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Re: [css-d] Use of empty DIVs?

2010-07-11 Thread Jukka K. Korpela
Tim Offenstein wrote:

> I'm seeing a number
> of students mark up their XHTML with descriptively named DIVs that
> have no counterpart in the CSS.

This is a general design issue and about markup, not CSS.

>From the CSS perspective, there are some risks, whether you mean classes or 
ids (or both) by "names". The "names" may pollute the name space, especially 
if people do not realize that id attributes must be unique. For example, I 
have seen a stituation with two id attributes (in code that I cannot change 
in any direct way) that differ in case of letters only, and it seems that 
when you have id="foo" and id="Foo" (violating HTML rules), browsers won't 
treat either of them as matching the selector #foo (or #Foo)! Similarly, if 
lots of class attributes are used extensively and carelessly, you might 
notice that setting properties for .bar sets them for elements you weren't 
thinking about (since in the past you forgot, I you had used class="bar" 
somewhere, or a previous author of the page did).

These can however be avoided by good general design and documentation, which 
is needed anyway, to keep track of the classes and ids you really need.

On the positive side, understandability of HTML source code is useful when 
you later modify or debug the CSS code. "Extra" names can be handy later in 
styling, as already mentioned in this discussion. And they can be 
indispensable to users who wish (or need) to set up a user style sheet for 
viewing the page: they cannot change the markup, they have to work with the 
"hooks" offered by classes, ids, and maybe other attributes present in the 
source,

> If this is an attempt to section/categorize the
> code, simple HTML comments will serve the purpose much better.

HTML comments are risky and clumsy. It's too easy to make a mistake in 
typing the  as well as use -- inside the comment. In CSS, 
comments are safer; their main problems are that they consume bandwidth 
(since comments are sent along with CSS code every time a browser requests 
for it) and that they they to degrade by time (people change code but don't 
update the comments).

Yucca 

__
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Use of empty DIVs?

2010-07-11 Thread Philip Taylor (Webmaster, Ret'd)


Chris F.A. Johnson wrote:

> Why XHTML?
>
> If a DIV isn't closed, it's not valid [X]HTML; it should get a
> failing grade.
>
> The classes and IDs can be used later when the CSS is modified.


I have to say, I'm more-or-less with Chris on this one.  An unclosed
DIV is no better and no worse than any other unclosed element that
requires closure, so saying "avoid DIVs because you might forget
to close them" makes little sense to me. But to address the real
issue : while I could see no reason whatsoever for

 ... 

I can see every reason for examples such as

 ...  ... 

where the two inner DIVs together compose a single
logical unit, the limits of which are delimited by
the outer DIV.

Philip Taylor
__
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Use of empty DIVs?

2010-07-11 Thread Chris F.A. Johnson
On Sun, 11 Jul 2010, Val Dobson wrote:

> I agree with you. Information within the code that's meant for humans
> to read should go into comments; div and ID names themselves should be
> fairly descriptive anyway (#maincontent, #leftcol etc.).

   #leftcol is not a good name. What if the design changes later and
   that column is on the right?

-- 
   Chris F.A. Johnson, 
   Author:
   Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)
   Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
__
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Use of empty DIVs?

2010-07-11 Thread Chris F.A. Johnson
On Sun, 11 Jul 2010, Tim Offenstein wrote:

> I'd like some feedback on this. I'm teaching a class on web design
> to students who've had various levels of training. I'm seeing a
> number of students mark up their XHTML

   Why XHTML?

> with descriptively named DIVs that have no counterpart in the CSS.
> Is this some kind of XML holdover or what? Am I missing some coding
> practice or method for why this is being done? I don't recommend
> this because (1) it clogs up the HTML with useless stuff, and (2)
> there's potential to break the page if a DIV isn't closed.

   If a DIV isn't closed, it's not valid [X]HTML; it should get a
   failing grade.

> If this is an attempt to section/categorize the code, simple HTML
> comments will serve the purpose much better.

   The classes and IDs can be used later when the CSS is modified.

-- 
   Chris F.A. Johnson, 
   Author:
   Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)
   Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
__
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Use of empty DIVs?

2010-07-11 Thread Val Dobson
I agree with you. Information within the code that's meant for humans
to read should go into comments; div and ID names themselves should be
fairly descriptive anyway (#maincontent, #leftcol etc.).  HTML
elements such as divs are meant to be read only by the browser and
making the browser search the stylesheet for non-existent elements
must have some effect on performance.
And, as you point out, there's scope for forgetting to close a div.

Val


On 11 July 2010 21:10, Tim Offenstein  wrote:
> I'd like some feedback on this. I'm teaching a class on web design to 
> students who've had various levels of training. I'm seeing a number of 
> students mark up their XHTML with descriptively named DIVs that have no 
> counterpart in the CSS. Is this some kind of XML holdover or what? Am I 
> missing some coding practice or method for why this is being done? I don't 
> recommend this because (1) it clogs up the HTML with useless stuff, and (2) 
> there's potential to break the page if a DIV isn't closed. If this is an 
> attempt to section/categorize the code, simple HTML comments will serve the 
> purpose much better.
>
> Any thoughts?
>
> -Tim
>
-- 
---
"Somewhere, something incredible is waiting to be known" - Carl Sagan
www.oakleafdesignprint.co.uk
www.oakleafcircle.org.uk
www.valdobson.co.uk
www.astrodiary.co.uk
__
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


[css-d] Use of empty DIVs?

2010-07-11 Thread Tim Offenstein
I'd like some feedback on this. I'm teaching a class on web design to students 
who've had various levels of training. I'm seeing a number of students mark up 
their XHTML with descriptively named DIVs that have no counterpart in the CSS. 
Is this some kind of XML holdover or what? Am I missing some coding practice or 
method for why this is being done? I don't recommend this because (1) it clogs 
up the HTML with useless stuff, and (2) there's potential to break the page if 
a DIV isn't closed. If this is an attempt to section/categorize the code, 
simple HTML comments will serve the purpose much better. 

Any thoughts? 

-Tim

__
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/