Forum Moderators: not2easy

Message Too Old, No Replies

radiobutton label

         

dexter

2:52 am on Feb 28, 2005 (gmt 0)

10+ Year Member



hi,

i need a little help with the radiobutton and the label formating by css. how can i get both align?

i put a border around to see the issue.
<No URLs, thanks. See TOS [WebmasterWorld.com] and CSS Forum Charter [WebmasterWorld.com]>

xhtml:

<span class="radio_row">
<input type="radio" class="Radio" /><span class="radio_label">The Lable Text</span>
</span>

css:

.radio_row{
border: 1px solid gray;
}

.radio_label{
border: 1px solid gray;
}

[edited by: SuzyUK at 10:44 am (utc) on Feb. 28, 2005]

kaled

10:54 am on Feb 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Why use <span> when <label> is designed for the job. Click on the label and radio box is selected.

You should be able to discard both <span> tags.
It might sort out alignment issues too.

Kaled.

dexter

5:03 pm on Feb 28, 2005 (gmt 0)

10+ Year Member



thanks,
but also the lable tag alone doesnt solve the problem.

code:
<lable class="radio_row"><input type="radio" class="radio_btn" />The Lable Text</label>

<Sorry, no personal URLs.
See Terms of Service [webmasterworld.com]>

[edited by: tedster at 8:52 pm (utc) on Feb. 28, 2005]

kaled

7:50 pm on Feb 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The correct code should be

<label class="radio_row"><input type="radio" class="radio_btn" />The Lable Text</label>

Notice the spelling of label and also notice that it wraps the input (unlike the example).

Kaled.

dexter

9:31 pm on Feb 28, 2005 (gmt 0)

10+ Year Member



oh sorry for the mistakes.
but also in the right way the label is a bit below the button. i guess there is no way to bring both in one line.