Topic: two styles in line without span? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=11136" title="Pages that link to Topic: two styles in line without span? (Page 1 of 1)" rel="nofollow" >Topic: two styles in line without span? <span class="small">(Page 1 of 1)</span>\

 
wcr one
Paranoid (IV) Inmate

From: seattle
Insane since: Mar 2001

posted posted 01-21-2004 22:57

Hey,

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.

all help is, as usual, greatly appreciated.

thanks

bill

Veneficuz
Paranoid (IV) Inmate

From: A graveyard of dreams
Insane since: Mar 2001

posted 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 -

wcr one
Paranoid (IV) Inmate

From: seattle
Insane since: Mar 2001

posted posted 01-22-2004 18:17

Vene,

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.

thanks

b

Ramasax
Paranoid (IV) Inmate

From: PA, US
Insane since: Feb 2002

posted posted 01-22-2004 18:31

DL = Definition List
DT = Definition Term
DD = Definition Definition?

Structured like this:

code:
<dl>
<dt>Term1</dt>
<dd>Definition1</dd>
<dt>Term2</dt>
<dd>Definition2</dd>
<dt>Term3</dt>
<dd>Definition3</dd>
</dl>



DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 01-22-2004 18:50

For the record:

DD = Definition Data.

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).]

mobrul
Bipolar (III) Inmate

From:
Insane since: Aug 2000

posted posted 01-22-2004 20:21

This might be one of those times where it is totally correct to use tables.
Consider the following:

code:
<style type='text/css'>
table{
border:1px solid #000000;
}
th{
padding-right:15px;
font-size:16px;
font-weight:bold;
text-align:left;
}
thead th{
background:#000000;
color:#ffffff;
text-align:center;
margin:0px;
}
td{
text-align:right;
}
</style>

<body>
<table>
<caption>Dimensions of Product XYZ</caption>
<thead>
<tr>
<th>Dimension</th>
<th>Size (in mm)</th>
</tr>
</thead>
<tr>
<th>Hatch Size</th>
<td>4-7</td>
</tr>
<tr>
<th>Preanal Length</th>
<td>~60</td>
</tr>
<tr>
<th>Flexion Length</th>
<td>11-13</td>
</tr>
</table>
</body>



wcr one
Paranoid (IV) Inmate

From: seattle
Insane since: Mar 2001

posted posted 01-22-2004 23:01

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).]

ozphactor
Maniac (V) Inmate

From: California
Insane since: Jul 2003

posted posted 01-25-2004 06:27

And just for the record, you can remove the line-break after a header by applying "display: inline" to the <hn> element.

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 01-25-2004 17:41

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.



HZR
Bipolar (III) Inmate

From: Cold Sweden
Insane since: Jul 2002

posted posted 01-25-2004 18:16

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
Bipolar (III) Inmate

From: midair
Insane since: Jul 2001

posted posted 01-25-2004 20:29

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<style type="text/css">
body {color: #000000; background: #ffffff;}
.cap {width: 400px; text-align: center; font-weight: 600; background: blue;}
.main {
width: 400px;
margin:0px;
border: 1px #9b9b9b solid;
padding: 0px;
margin: 0px;
}
.rbox {width: 30%;
float: right;
text-align: left;
line-height: 20px;
}
.lbox {width: 70%;
float: left;
line-height: 20px;
}
ul {
margin: 5px;
padding: 0px;
}
.left li {
text-align:left;
margin: 0px;
padding: 0px;
list-style-type: none;
display: block;
width: 100%;
}
.right li{
text-align: center;
margin: 0px;
padding: 0px;
list-style-type: none;
display: block;
}
#x {background: black; color: white; font-weight: 500;}
#x2 {background: red; color: blue; font-size: 115%;}


</style>

</head>
<body>
<div class=cap>Dimensions of Product XYZ</caption></div>
<div class="main">
<div class="rbox">
<ul class="right">
<li id="x">Size (in mm)</li>
<li>4-7</li>
<li>~60</li>
<li>11-13</li>
<li>16-31</li>
</ul>
</div>
<div class="lbox">
<ul class="left">
<li id="x2">Dimension</li>
<li>Hatch Size (min-max in mm SL): </li>
<li>Preanal Length (SL): </li>
<li>Flexion Length (in mm SL): </li>
<li>Length of Transformation (in mm SL):</li>
</ul></div>
</div>
</body>
</html>




[This message has been edited by skyetyger (edited 01-25-2004).]

HZR
Bipolar (III) Inmate

From: Cold Sweden
Insane since: Jul 2002

posted posted 01-25-2004 20:37

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).]

skyetyger
Bipolar (III) Inmate

From: midair
Insane since: Jul 2001

posted posted 01-25-2004 20:49

Try it without CSS..what do you mean by that?

HZR
Bipolar (III) Inmate

From: Cold Sweden
Insane since: Jul 2002

posted posted 01-25-2004 20:53

Try this only

code:
<div class=cap>Dimensions of Product XYZ</caption></div>
<div class="main">
<div class="rbox">
<ul class="right">
<li id="x">Size (in mm)</li>
<li>4-7</li>
<li>~60</li>
<li>11-13</li>
</ul>
</div>
<div class="l">
<ul class="left">
<li id="x">Dimension</li>
<li>Hatch Size</li>
<li>Preanal Length</li>
<li>Flexion Length</li>
</ul></div>
</div>


Would such a document make sense to you?

skyetyger
Bipolar (III) Inmate

From: midair
Insane since: Jul 2001

posted posted 01-25-2004 21:14

I tried mobrul's table solution without the tables..it didn't make much sense either

skyetyger
Bipolar (III) Inmate

From: midair
Insane since: Jul 2001

posted posted 01-25-2004 22:07

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?

I think it answers the question

HZR
Bipolar (III) Inmate

From: Cold Sweden
Insane since: Jul 2002

posted posted 01-25-2004 22:11

Sigh

quote:
I tried mobrul's table solution without the tables..it didn't make much sense either


Tables are part of the structure, CSS is not.

[This message has been edited by HZR (edited 01-25-2004).]

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 01-25-2004 22:13

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).]

HZR
Bipolar (III) Inmate

From: Cold Sweden
Insane since: Jul 2002

posted posted 01-25-2004 22:25
quote:
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 wouldn't say that. There are appropriate ways to achieve the "classic 'header > sub-content' way", using headings and paragraphs for example.

skyetyger
Bipolar (III) Inmate

From: midair
Insane since: Jul 2001

posted posted 01-25-2004 22:45

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).]

Veneficuz
Paranoid (IV) Inmate

From: A graveyard of dreams
Insane since: Mar 2001

posted 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 -

skyetyger
Bipolar (III) Inmate

From: midair
Insane since: Jul 2001

posted posted 01-26-2004 01:43

O boy..another way..NO TABLES NO CSS....LOL

<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).]

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 01-26-2004 03:16
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).]

HZR
Bipolar (III) Inmate

From: Cold Sweden
Insane since: Jul 2002

posted posted 01-26-2004 10:16
quote:
It's applications are far more broad in scope than you're taking it to be.


Because it has been abused so much maybe.

I think we should stop the discussion about definition lists though, we have different opinions and it's pretty off-topic

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 01-26-2004 13:57

Let me echo your ~sigh~

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.

HZR
Bipolar (III) Inmate

From: Cold Sweden
Insane since: Jul 2002

posted posted 01-26-2004 14:23
quote:
it is not because it has been abused.


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).]

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 01-26-2004 16:07

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.

___________________
Emps

The Emperor dot org

Veneficuz
Paranoid (IV) Inmate

From: A graveyard of dreams
Insane since: Mar 2001

posted 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 -

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 01-26-2004 17:34

Veneficuz: Good find

On the use of DD (from one of the comments):

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.


http://www.webaim.org/techniques/structure/

Some good DL links:
http://www.benmeadowcroft.com/webdev/articles/definition-lists.shtml

[edit: And I suppose this:
www.in-dented.com ]

On the same lines as this discussion:
http://annevankesteren.nl/archives/2003/10/26/definition-lists

[edit: That said the specs do allow more flexible uses:

quote:
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.


http://www.w3.org/TR/html4/struct/lists.html#h-10.3

although this is disputed:
http://lists.w3.org/Archives/Public/www-html/2003Mar/0076.html

and I would tend to agree with that ]

___________________
Emps

The Emperor dot org

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 01-26-2004 18:04

I didn't say that people have not abused it.

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).]

HZR
Bipolar (III) Inmate

From: Cold Sweden
Insane since: Jul 2002

posted posted 01-26-2004 18:21
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-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 01-26-2004 18:47

listed on that same site under "definition" -

quote:
Act of ascertaining and explaining the signification; a description of a thing by its properties;



Works for me.... =)



Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 01-26-2004 19:48

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.


http://lists.w3.org/Archives/Public/www-html/2003Mar/0076.html

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/

___________________
Emps

The Emperor dot org

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 01-26-2004 21:48

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".

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 01-26-2004 22:02

DL: My readin is that this is not right but is the way some people seem to be suing it and part of the problem is that extra sentence fom the W3C.

___________________
Emps

The Emperor dot org

HZR
Bipolar (III) Inmate

From: Cold Sweden
Insane since: Jul 2002

posted posted 01-26-2004 22:24

Jukka Korpela (which is an expert when it comes to HTML and accessibility) makes some good points here: http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&c2coff=1&selm=Xns945D15175E635jkorpelacstutfi%40193.229.0.31

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 01-26-2004 22:41

HZR: Good find - his site has more stuff:
http://www.cs.tut.fi/~jkorpela/def.html

___________________
Emps

The Emperor dot org

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 01-29-2004 19:39

I simply can't agree with what he has written.

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).]



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu