Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts

    radio buttons display practices tips plz.

    Hi,

    I have a set 6 sets of 5 radio buttons. I would prefer to have each set in a row of 5 buttons but, can you tell me what best practice would be for spreading them out?

    I don't want confusion to creep in where a button is equidistant between 1 and 2 for example. I have used   to make it layout more clearly but I am not sure that is the correct/best way.

    Should I, instead, be adding padding to the right of the radio buttons?

    Code:
              <fieldset>
                <legend>Welcome</legend>
                1 <input type='radio' name="Welcome" /> &nbsp;&nbsp;&nbsp;&nbsp;
                2 <input type='radio' name="Welcome" /> &nbsp;&nbsp;&nbsp;&nbsp;
                3 <input type='radio' name="Welcome" /> &nbsp;&nbsp;&nbsp;&nbsp;
    
                4 <input type='radio' name="Welcome" /> &nbsp;&nbsp;&nbsp;&nbsp;
                5 <input type='radio' name="Welcome" /> &nbsp;&nbsp;&nbsp;&nbsp;
              </fieldset>
    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

  • #2
    Regular Coder
    Join Date
    Jun 2008
    Posts
    173
    Thanks
    2
    Thanked 9 Times in 9 Posts
    padding may not work. but you can use right margin

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    <style type="text/css">
    .radio{
    margin-right:35px;
    }
    </style>
    </head>
    <body>
       <fieldset>
                <legend>Welcome</legend>
                1 <input type='radio' name="Welcome" class="radio" />
                2 <input type='radio' name="Welcome" class="radio"  /> 
                3 <input type='radio' name="Welcome" class="radio"  />
                4 <input type='radio' name="Welcome" class="radio"  />
                5 <input type='radio' name="Welcome" class="radio"  />
              </fieldset>
    </body>
    </html>
    vineet
    Last edited by vineet; 12-19-2009 at 05:51 AM.

  • #3
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    Thanks, I'll try that.

    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

  • #4
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,854
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    How about
    Code:
    fieldset label{
    float:left;
    width:5em;
    text-align:right;
    }
    Code:
    <fieldset>
    	<legend>Set 1</legend>
    	<label>1<input type='radio' name="Welcome" /></label> 
    	<label>2<input type='radio' name="Welcome" /></label> 
    	<label>3<input type='radio' name="Welcome" /></label> 
    	<label>4<input type='radio' name="Welcome" /></label> 
    	<label>5<input type='radio' name="Welcome" /></label> 
    </fieldset>
    ?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #5
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    Ah, thanks. I hadn't thought of using label for help with spacing.

    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

  • #6
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,854
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Quote Originally Posted by bazz View Post
    Ah, thanks. I hadn't thought of using label for help with spacing.

    bazz
    That <label>s are not just for spacing. You could click on those labels to select the respective radio button, which enhances the usability.
    Last edited by abduraooft; 12-19-2009 at 10:55 AM.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #7
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    Thanks. yeh I knew about the accessibility bit but hadn't thought of using css with it for spacing

    server-side has kept me away from css and I am forgetting some of it.

    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •