<ul class="subsubsection" id="domaener">

  • Thread starter Luigi Donatello Asero
  • Start date
F

Frank Olieu

Jim Higson said:
This is why XHTML2 doesn't have h1, h2 ... h9 tags - it just has one header
tag, and the level of the header is defined by how many section tags it has
as ancestors. (snip)
So, under XHTML2 it will be impossible to improperly nest your headings,
which I think is rather neat.

Yes, neat indeed.
BTW, as you probably know, WHATWG has a similar, but slightly different
approach:
They also have a <section> element in their proposal, while they stick to
h1...h6 for headings (for backward compatibility). These headings may be used
arbitrarily, but they recommend using /only/ <h1>, in nested sections, in the
same way you would with <h> in XHTML2 (i.e. a third-level <h1> would be
equivalent to an <h3>).
(http://www.whatwg.org/specs/web-apps/current-work/#headings1)

Although not quite compliant with current HTML semantics, one could actually
use this method right *now* in HTML4 (using divs, h1s and appropriate css).
But I don't know what consequences it could have with search engines, for
instance...
 
A

Andy Dingley

Neredbojias said:
The last part is okay but you should do something like this:

#domaener { font-size:5500px; }
ul .subsubsection { color:chartreuse;background:vermillion; }

in the stylesheet.

Why?
 
L

Luigi Donatello Asero

Jim Higson said:
Luigi Donatello Asero wrote:



Personally, I would call that bad style. Not *that* bad, but not great. A
subsection is a section in a section, so selecting with a style rule like:

.section .section


Well, I think that it is easier for me to follow the method with
subsections....
Perhaps it is easier for search engines as well.
 
L

Luigi Donatello Asero

Frank Olieu said:
Although not quite compliant with current HTML semantics, one could actually
use this method right *now* in HTML4 (using divs, h1s and appropriate css).
But I don't know what consequences it could have with search engines, for
instance...

Apart from that I think that the method with subsections is easier for me.
 
J

Jonathan N. Little

Luigi said:
Well, I think that it is easier for me to follow the method with
subsections....
Perhaps it is easier for search engines as well.

Don't think search engines care what you call your CSS classes.
'section' or 'subsection' whatever works for you. What is not a good
idea it to have class names that describe the actual styling, e.g.
'redBordered'. Be more descriptive of the elements purpose
'productBlurb' with your class names, then if you decide to change the
style with a blue border you would just change the CSS and not edit the
markup to change class names to 'blueBordered'.
 
J

Jonathan N. Little

Andy Dingley said:

1) Even for the aesthetically-challenged it is a Pug-ugly color combination

2) chartreuse may be a valid color constant name, but vermillion is not.
 
N

Neredbojias

To further the education of mankind, "Andy Dingley

The class is then not "linked" to the id and can be used as a true class
elsewhere. Why impose unnecessary limits?
 
N

Neredbojias

To further the education of mankind, "Jonathan N. Little"
1) Even for the aesthetically-challenged it is a Pug-ugly color
combination

2) chartreuse may be a valid color constant name, but vermillion is
not.

It was an _example_, not a normative reference, Felix.
 
J

Jonathan N. Little

Neredbojias said:
To further the education of mankind, "Jonathan N. Little"


It was an _example_, not a normative reference, Felix.

Oh I thought it *was* Luigi's theme!

Felix?
 
N

Neredbojias

To further the education of mankind, "Jonathan N. Little"
Oh I thought it *was* Luigi's theme!

No, Luigi's theme is "I'll Do It My Way" (-but thanks for all the fish.)

Felix Unger. -The Odd Couple? Don't tell me you're too young; I know
better...
 
J

Jonathan N. Little

Neredbojias said:
To further the education of mankind, "Jonathan N. Little"
No, Luigi's theme is "I'll Do It My Way" (-but thanks for all the fish.)


Felix Unger. -The Odd Couple? Don't tell me you're too young; I know
better...

No I am afraid I am not too young, just missed the reference. I really
did think it was Luigi's CSS, should have know better because he uses a
restricted palette of the original 16-color Windows 3.x, security or
some such...
 
N

Neredbojias

To further the education of mankind, "Jonathan N. Little"
No I am afraid I am not too young, just missed the reference. I really
did think it was Luigi's CSS, should have know better because he uses a
restricted palette of the original 16-color Windows 3.x, security or
some such...

Hehe, really? Gawd, I picked the worst colours I could think of (-although
'fushia' was a close third.) 'Does make exampling more interesting,
however.
 
J

Jonathan N. Little

Neredbojias said:
To further the education of mankind, "Jonathan N. Little"
<[email protected]> vouchsafed:

Hehe, really? Gawd, I picked the worst colours I could think of (-although
'fushia' was a close third.) 'Does make exampling more interesting,
however.

Or puce.
 
J

Jim Higson

Don't think search engines care what you call your CSS classes.

I think in some cases Google might, because I once read a report by them
into what the most common class names where and what could be deduced from
them. For example, classes 'menu', 'main' and 'breadcrumbs' might be
treated specially.
 
J

Jonathan N. Little

Jim said:
I think in some cases Google might, because I once read a report by them
into what the most common class names where and what could be deduced from
them. For example, classes 'menu', 'main' and 'breadcrumbs' might be
treated specially.

I yes I read that on too, and that the most common document title was
'untitled'.
 
L

Luigi Donatello Asero

Jim Higson said:
I think in some cases Google might, because I once read a report by them
into what the most common class names where and what could be deduced from
them. For example, classes 'menu', 'main' and 'breadcrumbs' might be
treated specially.

But if you only have one menu and not more, you might call it
<div class="subsection" id="menu">
for example
 
A

Andy Dingley

Neredbojias said:
The class is then not "linked" to the id and can be used as a true class
elsewhere. Why impose unnecessary limits?

Good intent, but I don't think this CSS change gives any practical
benefit.

The "class" is the classname 'subsubsection' Nothing more than this.
There's no concept of either "ul .subsubsection" or "color and
background" existing anywhere here. It's not demonstrably wrong to
invent one, but it's certainly superfluous.

If we did invent a subsubsection class, then we might wish to apply
colours to it, and colours other than chartreuse (maybe a nice shade
of fuchsia?). We might even want to go around applying this particular
colour combination to lots of <ul> elements. In that case, then the CSS
rules you've specified here would become downright confusing.

It's unusual to apply both class and id to an element solely for the
purpose of selecting CSS. However it's perfectly valid HTML to do so,
and it's almost commonplace to do so (imagine a class used to indicate
CSS selection and an id used for DHTML). There are even fairly common
CSS techniques where combinations are useful, notably a menu with id
values that are constant from page to page and a class of "current"
that moves between elements.

We can even say that in general it's better HTML design to code around
attaching CSS to a class attribute and DHTML to an ID attribute. This
is because id "binds more tightly" than class in CSS, sufficiently
tight that it's awkward to work with (it's hard to make more specific
selectors than an existing id selector)

However in the case we have here, the problem was to apply CSS to an
element
<ul class="subsubsection" id="domaener">

We can do this by the combination. We can do this by class, or we can
do this by id. Without knowing the fuller context of the problem, it's
just un-knowable to know which is best. However we can (from
soundly-based best-practice arguments) saying that arbitrarily slicing
the CSS in two and attaching each half to different selectors certainly
_isn't_ a supportable decision.
 
D

dorayme


Um, somehow that always reminded me of "puke". Must be me...[/QUOTE]

....yes, I think so, things tend to remind you about the more
animal parts of earthling nature, the plumbing and so on. I have
a complete analysis of this. I have handed the dossier over to
Officer Bud White. He is not just all fists and side arms you
know... he can be very gentle and didactic... you will see...
 
N

Neredbojias

To further the education of mankind, "Andy Dingley
Good intent, but I don't think this CSS change gives any practical
benefit.

The "class" is the classname 'subsubsection' Nothing more than this.
There's no concept of either "ul .subsubsection" or "color and
background" existing anywhere here. It's not demonstrably wrong to
invent one, but it's certainly superfluous.

If we did invent a subsubsection class, then we might wish to apply
colours to it, and colours other than chartreuse (maybe a nice shade
of fuchsia?). We might even want to go around applying this particular
colour combination to lots of <ul> elements. In that case, then the CSS
rules you've specified here would become downright confusing.

It's unusual to apply both class and id to an element solely for the
purpose of selecting CSS. However it's perfectly valid HTML to do so,
and it's almost commonplace to do so (imagine a class used to indicate
CSS selection and an id used for DHTML). There are even fairly common
CSS techniques where combinations are useful, notably a menu with id
values that are constant from page to page and a class of "current"
that moves between elements.

We can even say that in general it's better HTML design to code around
attaching CSS to a class attribute and DHTML to an ID attribute. This
is because id "binds more tightly" than class in CSS, sufficiently
tight that it's awkward to work with (it's hard to make more specific
selectors than an existing id selector)

However in the case we have here, the problem was to apply CSS to an
element
<ul class="subsubsection" id="domaener">

We can do this by the combination. We can do this by class, or we can
do this by id. Without knowing the fuller context of the problem, it's
just un-knowable to know which is best. However we can (from
soundly-based best-practice arguments) saying that arbitrarily slicing
the CSS in two and attaching each half to different selectors certainly
_isn't_ a supportable decision.

I quite agree with your explanation. Generally, I use ids unless there
is a reason not to, but in this case it's hard to say what is _optimal_
without knowing the scope of the page(s). (Class is, of course,
preferable for assigning multi-element attributes.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top