简体   繁体   English

CSS组合框下拉位置

[英]CSS Combo box dropdown position

I searched the web but couldn't find a good answer for HTML/CSS designs: 我在网上搜索,但找不到HTML / CSS设计的好答案:

  • I have a menubar docked to the right of my screen 我的菜单栏停靠在屏幕右侧
  • The menu bar contains select elements (comboboxes) with a fixed width 菜单栏包含宽度固定的select元素(组合框)
  • Sometimes the content of those comboxes is too big to fit that fixed width 有时,这些combox的内容太大,无法容纳该固定宽度

Here the current behavior I'm noticing: 这是我注意到的当前行为:

  • in normal position, the choice is simply clipped and that's fine by me 在正常位置,选择只是被剪裁,这对我来说很好
  • in dropdown position, the dropdown 'box' isn't clipped but is aligned to the left side of the combobox; 在下拉位置,下拉框未裁剪,但与组合框的左侧对齐; as a consequence it goes beyond the right side of the screen and part of it is simply unreadable 结果,它超出了屏幕的右侧,并且部分内容根本无法读取

    例


What I would like to do is force the dropdown box to align with the right of its parent combobox. 我要执行的操作是强制下拉框与其父组合框的右侧对齐。

Any way to do that in CSS - or even JS I guess but not the preferred solution...? 有什么方法可以在CSS中-甚至我想在JS中也可以,但不是首选解决方案...?

you'll be out of luck here with pure css. 在这里,纯CSS会让您不走运。
you could look for a javascript combobox though and style that with css. 您可以寻找javascript组合框,并使用CSS设置样式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM