在< select& gt;上移动箭头位置.菜单 [英] Moving the arrow position on a <select> menu

查看:55
本文介绍了在< select& gt;上移动箭头位置.菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用CSS从右向左移动选择框上的下拉箭头?

Is it possible to move the dropdown arrow on a select box from right to left with CSS?

推荐答案

编辑:正如我怀疑这会将列表中 option s的文本方向更改为好吧,所以您不能使用 direction .除此之外,除了使用自定义下拉控件外,别无其他方法.请参阅此问题的答案.我只会将下面的原始答案留给好奇的人.

just as I suspected this changes the text direction of the options in the list as well, so you can't use direction. Besides that, there isn't any other way than to use a custom drop-down control. See the answers to this question. I'll just leave my original answer below for anyone curious.

您应该能够使用 direction 属性,但我尚未验证该方法是否适用于浏览器,平台和语言环境:

You should be able to use the direction property, but I haven't verified if this works across browsers, platforms and locales:

select { direction: rtl; }

不过,在使用 direction 时要小心,因为 spec 建议除DTD作​​者或特殊文档作者以外的任何人使用它:

Be careful when using direction though, as the spec advises against its use by anyone but DTD authors or authors of special documents:

由于文本的方向性取决于文档语言的结构和语义,因此在大多数情况下,这些属性仅应由文档类型描述(DTD)的设计人员或特殊文档的作者使用.如果默认样式表指定了这些属性,那么作者和用户不应指定规则来覆盖它们.

Because the directionality of a text depends on the structure and semantics of the document language, these properties should in most cases be used only by designers of document type descriptions (DTDs), or authors of special documents. If a default style sheet specifies these properties, authors and users should not specify rules to override them.

这篇关于在< select& gt;上移动箭头位置.菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆