选择列表中的样式选项元素(添加填充和/或边距) [英] Style Option Elements in Select List (Add Padding and/or Margins)

查看:115
本文介绍了选择列表中的样式选项元素(添加填充和/或边距)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将选择列表/下拉列表的选项元素设置为背景和字体?我特意寻找添加一些填充/边距,所以列表不是那么狭窄。

Is it possible to style the option elements of a select list/dropdown beyond background and font? I'm specifically looking to add some padding/margins so the list isn't as cramped.

推荐答案

广泛的浏览器支持。至少IE不支持它。那么没有其他的选择,而不是用< ul>< li> 和一个很好的JavaScript来模拟和逐渐增强下拉列表。您可以获得这里一些想法,可以用JS( jQuery 实际上是基于的下拉菜单。

Not possible if you want broad browser support. At least IE doesn't support it. There's then no other option than to mimic and progressively enhance the dropdown with <ul><li> and a good shot of JavaScript. You can get here some ideas what's possible with JS (jQuery actually) based dropdowns.

这篇关于选择列表中的样式选项元素(添加填充和/或边距)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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