/    Sign up×
Community /Pin to ProfileBookmark

Size of a drop-down menu

Im working right now at a website with a form that a user needs to fill in. Text fields have a size of 24 characters, so how can i make a drop down menu that appears above the text fields appear the same size so it looks aligned?

to post a comment
HTML

3 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisOct 23.2007 — You can either use CSS to size both, or use some script to set the width of the select equal to the width of the text box.
<i>
</i>&lt;select ... style="width: 100px"&gt;
...
&lt;input type="text" ... style="width: 100px"&gt;

I don't know if 24 characters will fit into 100px, but you can figure it out.
Copy linkTweet thisAlerts:
@TJ111Oct 23.2007 — <i>
</i>select {
width:25em;
}

em = character-size, its good to use that instead of pix for accessibility reasons (ie, poeple who have to use enlarged text).
Copy linkTweet thisAlerts:
@nestor_cantuauthorOct 24.2007 — thanks a lot!
×

Success!

Help @nestor_cantu spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...