如何使<选项>比

发布于 2024-08-11 09:30:38 字数 204 浏览 3 评论 0原文

的内容比这个长。

在IE6中是隐藏的。

在此处输入图像描述

如何解决这个问题?

The <select> has a width of 60px,

but the content of <option> is longer than that.

Which is hidden in IE6.

enter image description here

How to fix that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

秋风の叶未落 2024-08-18 09:30:38

我之前尝试过解决这个问题,但我能找到的只是 javascript hacks。我曾经发现一个效果很好的方法,但我不知道在哪里。

你可以试试这个:
http://brandonbuttars.com/2009/09 /css-select-options-internet-explorer-cut-off/

或者 Google 上的许多其他选项:
http://www.google.ca/search?hl=en&safe=off&q=ie6+cutoff+select+options&btnG=Search&meta=&aq=f&oq =

I've tried to figure this out before and all I could find were javascript hacks. I found one once upon a time that worked well but I don't know where.

You could try this:
http://brandonbuttars.com/2009/09/css-select-options-internet-explorer-cut-off/

Or plenty of other options on Google:
http://www.google.ca/search?hl=en&safe=off&q=ie6+cutoff+select+options&btnG=Search&meta=&aq=f&oq=

请叫√我孤独 2024-08-18 09:30:38

我们在 select 旁边添加了一个按钮,将 select 的宽度更改为默认值,因此它的宽度变得不受限制。

We added a button next to select which change select's width to default value, so it becomes non-limited in width.

你的他你的她 2024-08-18 09:30:38

简短而简单的答案:如果没有 JavaScript,这是不可能的。使用 JavaScript 解决方案,当 select 变宽时,您的布局将跳跃

有关更多信息,请参阅我对重复线程的评论。

Short and easy answer: it´s not possible without JavaScript. And with the JavaScript-solution your layout will jump when the select gets wider.

See my comment on duplicate threads for more info.

夜巴黎 2024-08-18 09:30:38

不幸的是这是不可能的。您可以使用如下所示的自定义脚本: http://www.icant.co.uk/ forreview/tamingselect/,但它仍然是基于 JavaScript 的解决方案。

Unfortunately this is not possible. You could use custom scripts like this one: http://www.icant.co.uk/forreview/tamingselect/, but still - it is JavaScript based solution.

心房敞 2024-08-18 09:30:38

我知道这是几年后的事,但它可能会帮助人们寻找解决方案。

您可以在 CSS 中通过设置聚焦时的选择宽度来完成此操作,例如

select {
    width: 100px; /* normal state */
}

select:focus {
    width: 200px; /* wider when in focus */
}

完整文章位于 http:// dinowebs.net/?p=114

I know this is years later but it may help someone searching for a solution.

You can do it in CSS by setting the select's width when it is in focus, e.g.

select {
    width: 100px; /* normal state */
}

and

select:focus {
    width: 200px; /* wider when in focus */
}

Full article at http://dinowebs.net/?p=114

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文