/    Sign up×
Community /Pin to ProfileBookmark

enlarge width of a dropdown menu when opened

hi everyone..
i need some help to make a dropdown menu that is small when it is closed, but the options are bigger when it’s opened
an example is attached

i found this using style but it did not work for me

[code=html]
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en” lang=”en”>
<head>
<title>fixed select width</title>

<meta http-equiv=”Content-Type” content=”application/xhtml+xml; charset=utf-8″ />

<style type=”text/css”>
/*<![CDATA[*/
select {
width:550px;
}
option {
width:534px;
overflow:hidden;
}
/*//]]>*/
</style>

</head>
<body>

<form action=”#”>
<div>
<select>
<option></option>
<option>big option</option>
<option>big option big option big option big option big option big option big option big option big option big option big option big option big option big option big option big option</option>
</select>
</div>
</form>

</body>
</html>
[/code]

[upl-file uuid=7b52b665-a073-4b8b-b978-a0cc731ba262 size=16kB]12.jpg[/upl-file]

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @saifo0o0o 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.3,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...