I wanted to get two styles, say, bold and "normal" in the same line, but was wondering if it is possible without using <span class=whatever>? I have a large number of these on several pages and would like to not use that many spans.
Hatch Size (min-max in mm SL): 4 - 7 Preanal Length (SL): ~60 Flexion Length (in mm SL): 11-13 Length at Transformation (in mm SL): 16-31
etc, etc. with the first part bolded and the later "normal".
the site is at http://161.55.120.152/ichweb/index.cfm if you want to have a look. it is still in development and I am now going back and cleaning up the css and hoped to get rid of as much class items as possible (and replacing them ala zeldman with id functionality). The newer css is not on the server yet, but the functionality is the same.
From: A graveyard of dreams Insane since: Mar 2001
posted 01-22-2004 00:09
If you want the text to be bold, why don't you use the <strong> tag? The <strong> tag is the one you should use whenever you want to have bold text.
In your example you could also use the <dl>,<dt>,<dd> tags, like:
code:
<dl>
<dt>Hatch Size (min-max in mm SL):</dt>
<dd>4 - 7</dd>
...
</dl>
And then style the <dt> and <dd> tags as you want. I think that might be the sematicly more correct way of doing it.
_________________________
"There are 10 kinds of people; those who know binary, those who don't and those who start counting at zero"
- the Golden Ratio -
thanks for the input. I was so focusing on keeping style in the css and structure in the html I hadn't really thought about strong.
I am a bit confused though, what are the dl, dt, and dd tags. I don't know that I have seen these before, or if I have my early onset senility has wiped them from my head.
Definition Lists are an excellent tool, and would work well here since you seem to be making a list anyway, but <strong> is also a perfectly acceptable way to differentiate in this case.
Although <strong> is used almost interchangeably with <b>, it doesn't by any means equal "bold".
It states, in a structural sense, that the text contained within the tags has importance over the text around.
How you display that visually is still a matter left to CSS.
[This message has been edited by DL-44 (edited 01-22-2004).]
Of course right after I hit the submit button, I thought "um, you could do a search on it idiot". But to be honest you guys described it much better than anything I found.
I guess it is really not so much a list though. it is the field heading (strong) and the associated results for a species returned from a search string. But I did not want to use <h> because it breaks after the close and I wanted to keep it all on one line. This does not fit in with the stricter definition of strong as this part does not have a greater importance as much as the "header" needs to be differentiated from the data associated with it and makes the sections seem less jumbled, more delineated.
bill
[This message has been edited by wcr one (edited 01-22-2004).]
1) As Mobrul said, a table would be perfectly acceptable here.
2) It would also be very valid as a lsit still though - it is a list of information returned by the search string.
3) <strong> would still most certainly be applicable. Not saying that's necessarily what you should do, but the idea of strong is exactly what you've described - the particular text needs to be differentiated, and as a header it is a more prominent piece.
A table would be best since it's certainly not a definition list. Does "11-13" define "Flexion Length (in mm SL)"? No.
Use mobrul's table (and add a required <tfoot> to it).
[This message has been edited by HZR (edited 01-25-2004).]
skyetyger, you seem to think that tables are not acceptable at all. They are, when used for tabular data, and that is. Besides, your structure doesn't make sense at all (try it without CSS).
[This message has been edited by HZR (edited 01-25-2004).]
quote**I wanted to get two styles, say, bold and "normal" in the same line, but was wondering if it is possible without using <span class=whatever>? I have a large number of these on several pages and would like to not use that many spans.**/quote
I posted my answer to the question..it is possible..
I used #x for both cells..however one cell ~ li~ could be <li id=#x> where #x{bold} and the cell2 in the line <li id=#x2> where #x2 {normal}--does that make sense?
For the record - a "definition" list does not necessarily mean a dictionary style definition.
It is not limited to listing a term, and then posting a definition. It stands in the classic 'header > sub-content' way.
I would say that a table or a definition list are semantically "equal" in this case.
skytyger - yes, you answered the question. The problem is that the answer you provided is not a very satisfactory one. Nobody is debtaing whether or not the question asked was "possible". There are a multitude of methods listed in this post. The only thing being debated now is which way would be better.
[This message has been edited by DL-44 (edited 01-25-2004).]
I suppose the lists could be wrapped in tables and placed in the style section if that is a structurally sound way to write it ..but the way I posted is a way to format every single cell individually..I don't see that with tables or am I missing something..can every table cell be formatted independently..col and row?
I have to edit my edits for typos.so I have changed the html document above..retry it to see the new individual formatting..
[This message has been edited by skyetyger (edited 01-25-2004).]
From: A graveyard of dreams Insane since: Mar 2001
posted 01-26-2004 00:00
It is possible to format every cell in a table indepentant on each other. In Mobruls example above the CSS for the <th> tag defines the style for the first column, while the CSS for the <td> tag define the style for the second column. If you want to use the same style for all rows, you style the <tr> element. If you want a specific cell to have a particular style, you can use classes to style it and just give it an class="name" attribute. Every style specified in the class will override the styles given by the previous definitions, so you can easily style it the way you want to.
The DL can be used for other things than plain definition list. I think I saw some examples over at w3 where they showed how to use it to display a dialog. The talker's name was in the DT while what he said was in the DD. Another example of the DL being used for another purpose (while bein sematicly correct) was discussed at SimpleBits a while ago.
_________________________
"There are 10 kinds of people; those who know binary, those who don't and those who start counting at zero"
- the Golden Ratio -
<body>
<pre> <b> DIMENSIONS OF PRODUCT XYZ</b>
<b>DIMENSION</b> <b>SIZE (in mm)</b>
<b>Hatch Size</b> (min-max in mm SL): 4-7 </pre>
</body>
The pre command will hold as TYPED..so if you C/P this..you have to reinsert the space bar between the dimension/size because this post will not hold the spaces as I wrote it..that I can figure..
[This message has been edited by skyetyger (edited 01-26-2004).]
quote:...using headings and paragraphs for example.
Yes....for normal textual contexts.
But we're talking about a list. So to acheive that heirarchy with a list, a <dl> is the perfect and appropriate way to do that.
Again, I must say, people very often misimterpret the purpose of <dl>'s based on the term "definition". It's applications are far more broad in scope than you're taking it to be.
Skytyger - I am afraid you are missing the point very drastically. For starters, in your altest example, there is no need for the <pre> tag whatsoever, and the <strong> tag is the semantically correct version of the <b> tag, and should be used in such cases. This solution was the first one listed, in the first reply as well.
The only thing being debated at the moment is the most appropriate way to accomplish this, speaking from a "semantically correct" coding prespective.
[This message has been edited by DL-44 (edited 01-26-2004).]
it is not because it has been abused. It's intention is not the limited to the narrow view you are taking of the word "definition". It's not off-topic, since this pretty much is the topic....
A definition list is every bit as semantically correct as a table in this application.
It has. People are using it to achieve visual effects and using it for things it wasn't designed for.
quote:It's intention is not the limited to the narrow view you are taking of the word "definition".
Says who? Jeffrey Zeldman? (see the markup for the list of links on his site)
And what is your broader view of the word "definition"?
Yea, sure, the specification says "Another application of DL, for example, is for marking up dialogues, with each DT naming a speaker, and each DD containing his or her words.", which I think is totally illogical. Why the hell did they name it definition list then? That is beyond me.
quote:It's not off-topic, since this pretty much is the topic....
I think it's off-topic, since we're not really discussing anything related to the original post, but rather what definition lists should or shouldn't be used for, but maybe it doesn't really matter since threads normally evolve like this.
quote:A definition list is every bit as semantically correct as a table in this application.
And I _still_ disagree with you.
[This message has been edited by HZR (edited 01-26-2004).]
HZR: I thought the question had been pretty much answered:
If he wants it as he shows it then:
code:
<strong>Hatch Size (min-max in mm SL)</strong>: 4 - 7
<strong>Preanal Length (SL)</strong>: ~60
<strong>Flexion Length (in mm SL)</strong>: 11-13
<strong>Length at Transformation (in mm SL)</strong>: 16-31
I he wants it in a tabular form then, as it is tabular data, it cn go in a table (as mobrul pointed out).
So back to the defintion list discussion:
DL: What other uses do you envision? Personally I'd use them only for defintions and I have rather avoided using them at all so I'm interested in other uses.
From: A graveyard of dreams Insane since: Mar 2001
posted 01-26-2004 16:30
Another use I would think of for the dl is floating images, like the methoed dicussed a while ago at SimpleBits. I won't go into how and why here, since it has allready been discussed there.
Only because the dl actually stands for Definition List, doesn't mean you should only use it for defintions. From what I've read over at w3 and other places I would say that thinking of the dl as a list pairing together sets of data (not only the term+definition pair) is more appropriate. If you look at it like that the specifications example of dialoge becomes reasonable, as well as the use dl for image+caption and the example above.
_________________________
"There are 10 kinds of people; those who know binary, those who don't and those who start counting at zero"
- the Golden Ratio -
quote:The JAWS screen reader speaks the word ?equals? between the term and description pairs of definition lists.
which suggests any use other than title = defintion aren't right.
Also:
quote:Using lists correctly
HTML lists - <ul>, <ol>, and <dl> - also convey a hierarchical content structure. Each of these have rules regarding their use as well. Unordered lists should be used when there is no order of sequence or importance. Ordered lists suggest a progression or sequence. Definition lists should be used explicitly for presenting a structure for definitions. As with heading, lists should be used correctly and for the right purposes. Unordered and ordered lists should always contain list items. Definition lists must always have definition descriptions. Empty lists are incorrect HTML. Lists should never be used for merely indenting or other layout purposes. Nested lists should be coded properly.
I said that abuse of the tag is not the reason that it's uses are more varied than simply dictionary style definitions.
Also, just because an application has been made which sees it one way, does not make it so. Web browsers have proved that point quite well.
Veneficuz summed it up best -
quote:as a list pairing together sets of data (not only the term+definition pair) is more appropriate
I have no idea what Zeldman says about the issue. I know what I've read at the w3c, and combined with some logical assocaitions, it's good enough for me. So they didn't name it perfectly - have they named everything perfectly?
And to get right down to it - this case does in fact involve definitions.
We take the term "Hatch Size (min-max in mm SL)" and we define that attribute as the value "4 - 7". So I really can't see any possible reason to object to the use of it, and I am - quite frankly - very confused over your strong objection...
{emperor - in the last link, there seems to be a very distinct lack of definitive conclusion there }
[This message has been edited by DL-44 (edited 01-26-2004).]
quote:We take the term "Hatch Size (min-max in mm SL)" and we define that attribute as the value "4 - 7". So I really can't see any possible reason to object to the use of it
Well, I don't really think that "4 - 7" is a definition of what "Hatch Size (min-max in mm SL)" is. IMO it would be something like "the physical dimension of..." if you know what I mean ( http://dictionary.reference.com/search?q=size ).
[This message has been edited by HZR (edited 01-26-2004).]
DL: That last link pretty much says it is a bad idea:
quote:The definition of the <dl> element seems to agree with me: http://www.w3.org/TR/html401/struct/lists.html#edef-DL
...until this bit:
"Another application of DL, for example, is for marking up dialogues, with
each DT naming a speaker, and each DD containing his or her words."
...which seems completely wrong to me, and at odds with both the name of the
element, and its description up until that point.
Also I agree with you when you say the fact that it has been abused doesn't mean it should be got rid of - these tags have meaning and, like the use of tables to present tabular data, they still have their place (as long as they aren't used as hacks for other deficiences and I can't really see a problem where DLs actually solve an issue apart from semantically marking upa ctual definitions).
On the question of WWZD (What Would Zeldman Do) I think the answer from his code is he steers clear from it unless it is used in the right way: http://www.alistapart.com/credits/
Emp - from what I read, that link says "well, I wouldn't really use it, but people disagree with me" which is quite a bit different from "that is improper use of this tag".
In the second link, he lists a series of definitions of the word "definition", some of which support my statements, and then says "we're only going to use this one deifinition which supports what I said". It's ridiculous to be selectively strict in that manner - to say we must take the word "definition" from the Defintion List literally, but then say that only one particular use of the word applies, when the w3c has given a more lateral use for the tag, and the word itself offers more varied applications.
It's not in any way about capitalizing on the default layout of the tag, as that is simple enough to mock in numerous ways. . .
[This message has been edited by DL-44 (edited 01-29-2004).]