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 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Mar 2012
    Posts
    7
    Thanks
    2
    Thanked 0 Times in 0 Posts

    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

  • #2
    New to the CF scene
    Join Date
    Mar 2012
    Posts
    7
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Also if anyone can tell me how to style the font in the drop-down boxes that'd be great too!! Thanks!!

    L

  • #3
    Regular Coder
    Join Date
    Dec 2010
    Posts
    423
    Thanks
    22
    Thanked 56 Times in 56 Posts
    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.

  • Users who have thanked aaronhockey_09 for this post:

    slynne212 (04-04-2012)

  • #4
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,609
    Thanks
    0
    Thanked 645 Times in 635 Posts
    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/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #5
    New to the CF scene
    Join Date
    Mar 2012
    Posts
    7
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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.

  • #6
    New to the CF scene
    Join Date
    Mar 2012
    Posts
    7
    Thanks
    2
    Thanked 0 Times in 0 Posts

    ugh

    ddddd
    Last edited by slynne212; 04-05-2012 at 05:32 PM.


  •  

    Tags for this Thread

    Posting Permissions

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