HighDots Forums  

how to break long legend tag caption into multiple lines?

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss how to break long legend tag caption into multiple lines? in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
dubing@gmail.com
 
Posts: n/a

Default how to break long legend tag caption into multiple lines? - 02-22-2007 , 08:32 PM






Hi,

We have some html source like this:

<div class="survey">
<form action="students/cbe-graduate-students/survey.html"
method="post" id="frmPbSurvey">

<fieldset class="survey_item">
<legend class="question"><span class="questionNumber">6.</span>If the
answer to question 11 is yes, do you think they provide adequate
services for advanced degree employment opportunities?</legend>

<input type="radio" name="tx_pbsurvey_pi1[7][0][0]" value="1" /
Quote:
No<br /
<input type="radio" name="tx_pbsurvey_pi1[7][0][0]" value="2" /
Quote:
Yes<br /
/fieldset

....
<fieldset ...>
</fieldset>

</form>
</div>

Some questions are pretty long and cannot fit in the layout. My
current style sheet has,

..survey div {margin-bottom: 10px;}
..survey_item {margin-top: 10px; margin-bottom: 10px;}
..question {font-size: 100%; font-weight: bold; }

What should I so long questions can be broken into multiple lines to
fit in the layout that has 450px width?

Thanks in advance for any help,

Bing



Reply With Quote
  #2  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: how to break long legend tag caption into multiple lines? - 02-23-2007 , 03:07 AM






Scripsit dubing (AT) gmail (DOT) com:

Quote:
legend class="question"><span class="questionNumber">6.</span>If the
answer to question 11 is yes, do you think they provide adequate
services for advanced degree employment opportunities?</legend
From the styling point of view, <legend> is a nightmare. The common
rendering of <legend> in browsers cannot be described in CSS terms, and CSS
settings have varying effects on it.

One of the problems is that normal wrapping does not take place, and setting
white-space: normal doesn't change this. You can insert explicit line breaks
in the markup, using <br>, but that would be awkward.

From the markup point of view, the problem of excessively long <legend>
texts should not appear. According to the HTML 4.01 specification, "The
LEGEND element allows authors to assign a caption to a FIELDSET. The legend
improves accessibility when the FIELDSET is rendered non-visually." It has,
among other things, the following example:

<FIELDSET>
<LEGEND>Current Medication</LEGEND>
Are you currently taking any medication?
<INPUT name="medication_now"
...
</FIELDSET>

So the general idea is that the legend is a short caption, or like a
low-level heading. Without context, it is of course impossible to make a
specific suggestion on the formulation. But generally, a legend that needs
to wrap (in fairly normal browsing situations) is too long and needs
reformulation.

Quote:
Some questions are pretty long and cannot fit in the layout.
Just put the questions inside the <fieldset> after the <legend> element.

Quote:
.question {font-size: 100%; font-weight: bold; }
Bolding long texts is generally counter-productive, since bold text is more
difficult to read. The legend might be bolded, but the question should be
normal text so that it can be read conveniently.

Quote:
What should I so long questions can be broken into multiple lines to
fit in the layout that has 450px width?
For all that you can know, 450px might not accommodate a _word_ without
wrapping. Stop imposing fixed widths, _especially_ on forms. A page with a
form is not supposed to be primarily an esthetic experience but a user
interface. Let form follow function. The user may need all the space
available.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/



Reply With Quote
  #3  
Old   
dubing@gmail.com
 
Posts: n/a

Default Re: how to break long legend tag caption into multiple lines? - 02-23-2007 , 09:18 AM



On Feb 23, 2:07 am, "Jukka K. Korpela" <jkorp... (AT) cs (DOT) tut.fi> wrote:
Quote:
Scripsit dub... (AT) gmail (DOT) com:

legend class="question"><span class="questionNumber">6.</span>If the
answer to question 11 is yes, do you think they provide adequate
services for advanced degree employment opportunities?</legend

From the styling point of view, <legend> is a nightmare. The common
rendering of <legend> in browsers cannot be described in CSS terms, and CSS
settings have varying effects on it.

One of the problems is that normal wrapping does not take place, and setting
white-space: normal doesn't change this. You can insert explicit line breaks
in the markup, using <br>, but that would be awkward.

From the markup point of view, the problem of excessively long <legend
texts should not appear. According to the HTML 4.01 specification, "The
LEGEND element allows authors to assign a caption to a FIELDSET. The legend
improves accessibility when the FIELDSET is rendered non-visually." It has,
among other things, the following example:

FIELDSET
LEGEND>Current Medication</LEGEND
Are you currently taking any medication?
INPUT name="medication_now"
...
/FIELDSET

So the general idea is that the legend is a short caption, or like a
low-level heading. Without context, it is of course impossible to make a
specific suggestion on the formulation. But generally, a legend that needs
to wrap (in fairly normal browsing situations) is too long and needs
reformulation.

Some questions are pretty long and cannot fit in the layout.

Just put the questions inside the <fieldset> after the <legend> element.

.question {font-size: 100%; font-weight: bold; }

Bolding long texts is generally counter-productive, since bold text is more
difficult to read. The legend might be bolded, but the question should be
normal text so that it can be read conveniently.

What should I so long questions can be broken into multiple lines to
fit in the layout that has 450px width?

For all that you can know, 450px might not accommodate a _word_ without
wrapping. Stop imposing fixed widths, _especially_ on forms. A page with a
form is not supposed to be primarily an esthetic experience but a user
interface. Let form follow function. The user may need all the space
available.

--
Jukka K. Korpela ("Yucca")http://www.cs.tut.fi/~jkorpela/
Thanks much for the lucid explanation! Really appreciated it. Looks
like <fieldset> and <legend> doesn't fit in out situation. I changed
to <div>, all looks better now.

Bing



Reply With Quote
  #4  
Old   
John Hosking
 
Posts: n/a

Default Re: how to break long legend tag caption into multiple lines? - 02-23-2007 , 10:04 AM



dubing (AT) gmail (DOT) com wrote:
Quote:
On Feb 23, 2:07 am, "Jukka K. Korpela" <jkorp... (AT) cs (DOT) tut.fi> wrote:

Scripsit dub... (AT) gmail (DOT) com:

From the markup point of view, the problem of excessively long <legend
texts should not appear. According to the HTML 4.01 specification, "The
LEGEND element allows authors to assign a caption to a FIELDSET. The legend
improves accessibility when the FIELDSET is rendered non-visually." It has,
among other things, the following example:

FIELDSET
LEGEND>Current Medication</LEGEND
Are you currently taking any medication?
INPUT name="medication_now"
...
/FIELDSET

So the general idea is that the legend is a short caption, or like a
low-level heading. Without context, it is of course impossible to make a
specific suggestion on the formulation. But generally, a legend that needs
to wrap (in fairly normal browsing situations) is too long and needs
reformulation.

Some questions are pretty long and cannot fit in the layout.

Just put the questions inside the <fieldset> after the <legend> element.


Thanks much for the lucid explanation! Really appreciated it. Looks
like <fieldset> and <legend> doesn't fit in out situation. I changed
to <div>, all looks better now.
Then it seems as if you didn't read all of Jukka's words. What's wrong with:

<fieldset class="survey_item">
<legend class="question"><span class="questionNumber">6.</span></legend>
If the answer to question 11 is yes, do you think they provide adequate
services for advanced degree employment opportunities?
<input type="radio" name="tx_pbsurvey_pi1[7][0][0]" value="1" />No<br />
?

--
John


Reply With Quote
  #5  
Old   
dubing@gmail.com
 
Posts: n/a

Default Re: how to break long legend tag caption into multiple lines? - 02-23-2007 , 01:50 PM



On Feb 23, 9:04 am, John Hosking <J... (AT) DELETE (DOT) Hosking.name.INVALID>
wrote:
Quote:
dub... (AT) gmail (DOT) com wrote:
On Feb 23, 2:07 am, "Jukka K. Korpela" <jkorp... (AT) cs (DOT) tut.fi> wrote:

Scripsit dub... (AT) gmail (DOT) com:
From the markup point of view, the problem of excessively long <legend
texts should not appear. According to the HTML 4.01 specification, "The
LEGEND element allows authors to assign a caption to a FIELDSET. The legend
improves accessibility when the FIELDSET is rendered non-visually." It has,
among other things, the following example:

FIELDSET
LEGEND>Current Medication</LEGEND
Are you currently taking any medication?
INPUT name="medication_now"
...
/FIELDSET

So the general idea is that the legend is a short caption, or like a
low-level heading. Without context, it is of course impossible to make a
specific suggestion on the formulation. But generally, a legend that needs
to wrap (in fairly normal browsing situations) is too long and needs
reformulation.

Some questions are pretty long and cannot fit in the layout.

Just put the questions inside the <fieldset> after the <legend> element.

Thanks much for the lucid explanation! Really appreciated it. Looks
like <fieldset> and <legend> doesn't fit in out situation. I changed
to <div>, all looks better now.

Then it seems as if you didn't read all of Jukka's words. What's wrong with:

fieldset class="survey_item"
legend class="question"><span class="questionNumber">6.</span></legend
If the answer to question 11 is yes, do you think they provide adequate
services for advanced degree employment opportunities?
input type="radio" name="tx_pbsurvey_pi1[7][0][0]" value="1" />No<br /
?

--
John
Aha! Thanks much for waking me up. I got the point now. Yup, looks
like that helps fix my problem.

Bing



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.