1. Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

How To Center a Dropdown Select Box - JScript

Discussion in 'Programming & Webmastering' started by jed, Nov 9, 2012.

  1. jed

    jed

    Joined:
    May 14, 2011
    Messages:
    285 (0.24/day)
    Thanks Received:
    45
    Hey all... Having some issues trying to figure out how to "center" my select boxes into the middle of the page. I tried <align="middle"> underneath the last <option value> but that didn't do anything.

    Here's what the page looks like. http://www.uni.edu/jbledsoe/jerseys.html I want the "Size" and "Quantity" drop boxes underneath the center of each jersey image... This is for a school project and I didn't get to ask the prof. cause he was helping others all class.

    Here's the script I have so far:

    Thanks for any help!
  2. Ross211

    Ross211

    Joined:
    Jan 9, 2010
    Messages:
    462 (0.28/day)
    Thanks Received:
    114
    Location:
    Kansas
    Wrap a div with align="center" around your select elements like this -

    Code:
    <div align="center">
    <select>
    ......
    </select>
    </div>
    
    You could also do this -

    Code:
    <div style="text-align:center">
    <select>
    ......
    </select>
    </div>
    
    There are many ways to do this but these 2 solutions will work :D

    /edit

    Forgot to share the fiddle I made -

    http://jsfiddle.net/FKYnx/
    Last edited: Nov 12, 2012
    jed says thanks.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guest)

Share This Page