By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,627 Members | 1,870 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,627 IT Pros & Developers. It's quick & easy.

Legend Tag

P: n/a
I'm trying to line up two columns in a form using html check boxes but
haven't been successful in aligning the right side. Left side is easy
enough but I can't get the right side to align within the legend tag.
Anyone have any ideas? I've tried using a table but that places the
right hand side outside of the legend tag, though does a good job of
alignment. Thanks, John

//desired left side:
<fieldset style="text-align:left;">
<legend><b>Type</b></legend>
<input type="checkbox" />Peanuts <br />
<input type="checkbox" />Popcorn <br />
<input type="checkbox" />Corn on the cob. <br />

//desired right side:
<input type="checkbox" />Apples <br />
<input type="checkbox" />Oranges and Pears <br />
<input type="checkbox" />Bananas <br />
</fieldset>
Oct 22 '08 #1
Share this Question
Share on Google+
5 Replies


P: n/a
jc***@lycos.com wrote:
I'm trying to line up two columns in a form using html check boxes but
haven't been successful in aligning the right side. Left side is easy
enough but I can't get the right side to align within the legend tag.
Anyone have any ideas? I've tried using a table but that places the
right hand side outside of the legend tag, though does a good job of
alignment. Thanks, John

//desired left side:
<fieldset style="text-align:left;">
<legend><b>Type</b></legend>
<input type="checkbox" />Peanuts <br />
<input type="checkbox" />Popcorn <br />
<input type="checkbox" />Corn on the cob. <br />

//desired right side:
<input type="checkbox" />Apples <br />
<input type="checkbox" />Oranges and Pears <br />
<input type="checkbox" />Bananas <br />
</fieldset>
You mean within the fieldset...right?

<fieldset>
<legend><b>Type</b></legend>
<div style="float: left">
<input type="checkbox" />Peanuts <br />
<input type="checkbox" />Popcorn <br />
<input type="checkbox" />Corn on the cob.
</div>

<input type="checkbox" />Apples <br />
<input type="checkbox" />Oranges and Pears <br />
<input type="checkbox" />Bananas <br />
</fieldset>
--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Oct 22 '08 #2

P: n/a
On Oct 21, 9:12*pm, "Jonathan N. Little" <lws4...@central.netwrote:
jc...@lycos.com wrote:
I'm trying to line up two columns in a form using html check boxes but
haven't been successful in aligning the right side. *Left side is easy
enough but I can't get the right side to align within the legend tag.
Anyone have any ideas? *I've tried using a table but that places the
right hand side outside of the legend tag, though does a good job of
alignment. *Thanks, John
//desired left side:
<fieldset style="text-align:left;">
<legend><b>Type</b></legend>
<input type="checkbox" />Peanuts <br />
<input type="checkbox" />Popcorn <br />
<input type="checkbox" />Corn on the cob. <br />
//desired right side:
<input type="checkbox" />Apples <br />
<input type="checkbox" />Oranges and Pears <br />
<input type="checkbox" />Bananas <br />
</fieldset>

You mean within the fieldset...right?
Correct - actually the title of the thread should have been
'fieldset'. :-) I'm trying to have left side and right side check
boxes and am having a difficult time in getting good alignment of the
right hand check boxes with the script above so am hopeful that
there's a trick I can use to accomplish this while keeping all 6 check
boxes in the same fieldset.
Oct 22 '08 #3

P: n/a
jc***@lycos.com wrote:
On Oct 21, 9:12 pm, "Jonathan N. Little" <lws4...@central.netwrote:
>jc...@lycos.com wrote:
>>I'm trying to line up two columns in a form using html check boxes but
haven't been successful in aligning the right side. Left side is easy
enough but I can't get the right side to align within the legend tag.
Anyone have any ideas? I've tried using a table but that places the
right hand side outside of the legend tag, though does a good job of
alignment. Thanks, John
//desired left side:
<fieldset style="text-align:left;">
<legend><b>Type</b></legend>
<input type="checkbox" />Peanuts <br />
<input type="checkbox" />Popcorn <br />
<input type="checkbox" />Corn on the cob. <br />
//desired right side:
<input type="checkbox" />Apples <br />
<input type="checkbox" />Oranges and Pears <br />
<input type="checkbox" />Bananas <br />
</fieldset>
You mean within the fieldset...right?

Correct - actually the title of the thread should have been
'fieldset'. :-) I'm trying to have left side and right side check
boxes and am having a difficult time in getting good alignment of the
right hand check boxes with the script above so am hopeful that
there's a trick I can use to accomplish this while keeping all 6 check
boxes in the same fieldset.
I gave you a s<fieldset>
<legend><b>Type</b></legend>
<div style="float: left">
<input type="checkbox" />Peanuts <br />
<input type="checkbox" />Popcorn <br />
<input type="checkbox" />Corn on the cob.
</div>

<input type="checkbox" />Apples <br />
<input type="checkbox" />Oranges and Pears <br />
<input type="checkbox" />Bananas <br />
</fieldsetolution:


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Oct 22 '08 #4

P: n/a
jc***@lycos.com wrote:
I'm trying to line up two columns in a form using html check boxes
Stop trying that.

For clarity, usability, and accessibility, put one field together with its
label on one line. End of story. End of problems.
<input type="checkbox" />Peanuts <br />
This is more logical and more accessible:

<div><input type="checkbox" id="peanuts" ...<label
for="peanuts">Peanuts</label></div>

Check your favorite HTML tutorial for info on <label>. If there's no such
info on it, restart learning HTML from a better tutorial.

--
Yucca, http://www.cs.tut.fi/~jkorpela/

Oct 22 '08 #5

P: n/a
<jc***@lycos.comwrote in message
news:b5**********************************@b31g2000 prf.googlegroups.com...
I'm trying to line up two columns in a form using html check boxes but
haven't been successful in aligning the right side. Left side is easy
enough but I can't get the right side to align within the legend tag.
Anyone have any ideas? I've tried using a table but that places the
right hand side outside of the legend tag, though does a good job of
alignment. Thanks, John

//desired left side:
<fieldset style="text-align:left;">
<legend><b>Type</b></legend>
<input type="checkbox" />Peanuts <br />
<input type="checkbox" />Popcorn <br />
<input type="checkbox" />Corn on the cob. <br />

//desired right side:
<input type="checkbox" />Apples <br />
<input type="checkbox" />Oranges and Pears <br />
<input type="checkbox" />Bananas <br />
</fieldset>
The problem is that you're misusing the legend tag. I have included some
example markup to show you how it should be used:

<legend>Chuck Norris</legend>

Oct 22 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.