Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-06-2010, 10:04 AM   PM User | #1
bazz
Master Coder

 
Join Date: Apr 2003
Location: in my house
Posts: 5,211
Thanks: 39
Thanked 201 Times in 197 Posts
bazz will become famous soon enoughbazz will become famous soon enough
semantic code for radio buttons help.

Hi,

I have a 'column' of radio buttons but , as I have coded it, they don't align with each other on the vertical because they position themselves according to where their descriptive word ends.

like this

Code:
<td class='rightTd'>
            <input type='hidden' name="file_sequence_1" value="1" /> 	
    	    <p>Text: <input type="radio" class='radio_button' name="text_or_list_1" checked='checked' value="text" /></p>
            <p>List: <input type="radio" class='radio_button' name="text_or_list_1" value="list" /></p> 
          </td>
Tempted to put them into a table to lay them out better, I suspect that would be 'wrong'. How would you do it? <dl>, <ul> or does it really matter? It is only for use in a cms where a desktop or laptop would be used to view the pages - if that makes a difference, to your answer.

bazz
__________________
"The day you stop learning is the day you become obsolete"! - my late Dad.

Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
Useful MySQL resource
Useful MySQL link
bazz is offline   Reply With Quote
Old 09-06-2010, 10:08 AM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,678
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Code:
<label>Text: <input type="radio" class='radio_button' name="text_or_list_1" checked='checked' value="text" /></label>
            <label>List: <input type="radio" class='radio_button' name="text_or_list_1" value="list" /></label>
and then specifically set display:block; to these labels.
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 09-06-2010, 10:45 AM   PM User | #3
bazz
Master Coder

 
Join Date: Apr 2003
Location: in my house
Posts: 5,211
Thanks: 39
Thanked 201 Times in 197 Posts
bazz will become famous soon enoughbazz will become famous soon enough
Thanks Abduraooft.

However, that only makes the display the same as when I used the <p> tags.

I am trying to make the radio buttons align vertically with each other. here's am image, if I can work out how to publish it


bazz
Attached Thumbnails
Click image for larger version

Name:	radio_images.jpg
Views:	24
Size:	3.6 KB
ID:	8856  
__________________
"The day you stop learning is the day you become obsolete"! - my late Dad.

Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
Useful MySQL resource
Useful MySQL link
bazz is offline   Reply With Quote
Old 09-06-2010, 10:57 AM   PM User | #4
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,587
Thanks: 5
Thanked 864 Times in 841 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
Quote:
Originally Posted by bazz View Post
I am trying to make the radio buttons align vertically with each other.
Then change the markup to this:
Code:
<label for="radio1">Text:</label> <input type="radio" id="radio1" class='radio_button' name="text_or_list_1" checked='checked' value="text" />
<label for="radio2">List:</label> <input type="radio" id="radio2" class='radio_button' name="text_or_list_1" value="list" />
And float the labels to the left (don’t forget to clear) and apply the same width to both of ’em.
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Old 09-06-2010, 11:02 AM   PM User | #5
SB65
Senior Coder

 
Join Date: Feb 2009
Location: West Yorkshire
Posts: 2,812
Thanks: 9
Thanked 681 Times in 675 Posts
SB65 will become famous soon enoughSB65 will become famous soon enough
Something like:

Code:
<label>Text: </label><input type="radio" class='radio_button' name="text_or_list_1" checked='checked' value="text" />
<label>List: </label><input type="radio" class='radio_button' name="text_or_list_1" value="list" />
with

Code:
label{float:left;clear:left;width:100px}
input{float:left}
would work.

EDIT: Ha, too slow....
SB65 is offline   Reply With Quote
Old 09-06-2010, 11:29 AM   PM User | #6
bazz
Master Coder

 
Join Date: Apr 2003
Location: in my house
Posts: 5,211
Thanks: 39
Thanked 201 Times in 197 Posts
bazz will become famous soon enoughbazz will become famous soon enough
Thanks all of you. workin' a treat now.

bazz
__________________
"The day you stop learning is the day you become obsolete"! - my late Dad.

Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
Useful MySQL resource
Useful MySQL link
bazz is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

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

Forum Jump


All times are GMT +1. The time now is 09:52 PM.


Advertisement
Log in to turn off these ads.