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-20-2012, 04:07 PM   PM User | #1
johndove523
New Coder

 
Join Date: Jul 2008
Posts: 76
Thanks: 23
Thanked 0 Times in 0 Posts
johndove523 is an unknown quantity at this point
help styling radio buttons

Please see attached gif and url: http://informaticseducation.org/inst...lication-form/

I think I need to create a new style (as not to affect all the other text inputs) to style these radio buttons correctly, which is:

[button first, then] label (directly adjacent to the right)

e.g., • Undergraduate • Graduate • Both • Other

Any help is appreciated. Thanks,

John
Attached Thumbnails
Click image for larger version

Name:	radiostyles.GIF
Views:	18
Size:	42.4 KB
ID:	11570  

Last edited by johndove523; 09-20-2012 at 04:10 PM.. Reason: addition
johndove523 is offline   Reply With Quote
Old 09-20-2012, 04:56 PM   PM User | #2
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,699
Thanks: 5
Thanked 875 Times in 850 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
You just need to remove display: list-item and width: 300px from span.wpcf7-form-control-wrap input. Or rather, only apply the width to text inputs. You can use the attribute selector ([type=text]) or a specific class selector that is added to these inputs.
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Users who have thanked VIPStephan for this post:
johndove523 (09-20-2012)
Old 09-20-2012, 05:17 PM   PM User | #3
Johnb21
New Coder

 
Join Date: Sep 2010
Posts: 63
Thanks: 1
Thanked 2 Times in 2 Posts
Johnb21 is an unknown quantity at this point
Quote:
Originally Posted by VIPStephan View Post
You just need to remove display: list-item and width: 300px from span.wpcf7-form-control-wrap input. Or rather, only apply the width to text inputs. You can use the attribute selector ([type=text]) or a specific class selector that is added to these inputs.
except he doesn't have control over those because those styles are built into the wordpress contact form 7 plugin. He would need to add styles to his own stylesheet that would override those.

Also, even if he were to remove them... it would not give him a vertical list of radio buttons rather a horizontal list.

The best way to achieve what you are looking to do is use this code in your own CSS stylesheet:

Code:
 span.wpcf7-list-item input[type="radio"]{
 display:inline;width:auto;
}

 span.wpcf7-list-item label{display:block;}
This code has been tested with your layout using the Web Developer Toolbar.
Johnb21 is offline   Reply With Quote
Users who have thanked Johnb21 for this post:
johndove523 (09-20-2012)
Old 09-20-2012, 05:22 PM   PM User | #4
Johnb21
New Coder

 
Join Date: Sep 2010
Posts: 63
Thanks: 1
Thanked 2 Times in 2 Posts
Johnb21 is an unknown quantity at this point
Apparently he is looking for an inline radio list... from the "before" layout, I figured he wanted to have them vertically laid out like they were just lined up and with the label on the right side.
Johnb21 is offline   Reply With Quote
Old 09-20-2012, 05:25 PM   PM User | #5
johndove523
New Coder

 
Join Date: Jul 2008
Posts: 76
Thanks: 23
Thanked 0 Times in 0 Posts
johndove523 is an unknown quantity at this point
Thank you! : )
johndove523 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 01:06 PM.


Advertisement
Log in to turn off these ads.