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 04-04-2012, 12:15 AM   PM User | #1
slynne212
New to the CF scene

 
Join Date: Mar 2012
Posts: 7
Thanks: 2
Thanked 0 Times in 0 Posts
slynne212 is an unknown quantity at this point
Fix drop-down width?

Hey all,

At the moment I have some drop-down options in a table and their width is fixed to the width of the longest option, is there a way to find out how long the longest drop-down is and set all drop-downs in the column to match?

Many thanks!!

Lynne
slynne212 is offline   Reply With Quote
Old 04-04-2012, 12:15 AM   PM User | #2
slynne212
New to the CF scene

 
Join Date: Mar 2012
Posts: 7
Thanks: 2
Thanked 0 Times in 0 Posts
slynne212 is an unknown quantity at this point
Also if anyone can tell me how to style the font in the drop-down boxes that'd be great too!! Thanks!!

L
slynne212 is offline   Reply With Quote
Old 04-04-2012, 06:14 AM   PM User | #3
aaronhockey_09
Regular Coder

 
Join Date: Dec 2010
Posts: 411
Thanks: 21
Thanked 55 Times in 55 Posts
aaronhockey_09 is an unknown quantity at this point
well if right now they are not fixed widths, you can use developer tools inside of your browser,, and click on the div, it should show the width, or trial and error just changing the width till the largest one is how it use to be when it was not fixed width.

As for the fonts.
You would just have set the font size and family and what ever else you want into your li or a tag.

so something like this

.navigation li ul li a { font-size:12px; font-family:ariel; }

hope this helps a bit.
aaronhockey_09 is offline   Reply With Quote
Users who have thanked aaronhockey_09 for this post:
slynne212 (04-04-2012)
Old 04-04-2012, 07:51 AM   PM User | #4
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,451
Thanks: 0
Thanked 496 Times in 488 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
Set the width in em so that it still fits if your visitor resizes all the text.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote
Old 04-04-2012, 04:21 PM   PM User | #5
slynne212
New to the CF scene

 
Join Date: Mar 2012
Posts: 7
Thanks: 2
Thanked 0 Times in 0 Posts
slynne212 is an unknown quantity at this point
Quote:
Originally Posted by aaronhockey_09 View Post
well if right now they are not fixed widths, you can use developer tools inside of your browser,, and click on the div, it should show the width, or trial and error just changing the width till the largest one is how it use to be when it was not fixed width.

As for the fonts.
You would just have set the font size and family and what ever else you want into your li or a tag.

so something like this

.navigation li ul li a { font-size:12px; font-family:ariel; }

hope this helps a bit.

Cool, thanks! Got the max width, now wondering what the best way to set it on all the dropdowns is? There's content between each dropdown so I can't wrap it all in one style...it'd be really cool if there were a way to get all dropdowns and text boxes to span the width of the table column that they're in, any idea how to achieve that?

Last edited by slynne212; 04-04-2012 at 04:23 PM..
slynne212 is offline   Reply With Quote
Old 04-04-2012, 06:36 PM   PM User | #6
slynne212
New to the CF scene

 
Join Date: Mar 2012
Posts: 7
Thanks: 2
Thanked 0 Times in 0 Posts
slynne212 is an unknown quantity at this point
ugh

ddddd

Last edited by slynne212; 04-05-2012 at 05:32 PM..
slynne212 is offline   Reply With Quote
Reply

Bookmarks

Tags
css, forms, html

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 11:55 AM.


Advertisement
Log in to turn off these ads.