对齐图标以选择标签
我试图让我的表格变得漂亮,但我不确定我在做什么。我有两个选择框和两组图标,我想将它们设置为如下格式:
^ +-------------+ +--------------+
| | | <-- | |
| Select 1 | --> | Select 2 |
| | | | |
v +-------------+ +--------------+
中间的左右图标将项目移入和移出选择框,左侧的向上和向下箭头移动选择中的项目1 上、下。使用 css 获得此布局的简单方法是什么?我已经能够用一个表格来破解一些东西,但我没有运气使用纯CSS解决方案。
I'm attempting to make my form pretty I'm not sure what I'm doing. I've got two select boxes and two sets of icons that I would like to format like this:
^ +-------------+ +--------------+
| | | <-- | |
| Select 1 | --> | Select 2 |
| | | | |
v +-------------+ +--------------+
The left and right icons in the middle move items to and from the Select boxes and the up and down arrows on the left move items in Select 1 up and down. Whats an easy to way to get this layout with css? I've been able to hack something together with a table I've had no luck with a pure css solution.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
给你:
现场演示
我冒昧地说添加
cursor:pointer
到按钮。从语义的角度来看,如果将它们从标签更改为
标签,效果会更好。
我还将
size="4"
添加到我没接触过JS。
在 IE7/8、Firefox、Chrome、Opera、Safari 中测试。
CSS:
HTML:
Here you go:
Live Demo
I took the liberty of adding
cursor: pointer
to the buttons. It would be better from a semantic point of view if you changed them from<img>
tags to<a>
tags.I also added
size="4"
to the<select>
tags to ensure consistent height between different browsers.I didn't touch the JS.
Tested in IE7/8, Firefox, Chrome, Opera, Safari.
CSS:
HTML:
注意:不跨浏览器友好 - JSFiddle。
NOTE: Not cross-browser friendly - JSFiddle.