简体   繁体   English

如何制作带有圆角的选择菜单

[英]How to make a select menu with rounded corners

我正在尝试使用带有圆角的css选择菜单,但是我的摆设没有这种运气,有什么建议吗?

This rules make rounded corners, you should add your code so I can help you a bit more 这条规则很圆滑,您应该添加代码,以便为您提供更多帮助

  -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    border-radius: 10px;

Generally, if you want decent styling on a select element, you need to make your own mock element (out of plain old DIVs, lists, and such). 通常,如果要在select元素上实现体面的样式,则需要制作自己的模拟元素(使用普通的旧DIV,列表等)。 To preserve form functionality, you can create a real hidden SELECT and use script to synchonize its state with the mock element the user is actually interacting with. 为了保留表单功能,您可以创建一个真正的隐藏SELECT并使用脚本将其状态与用户实际与之交互的模拟元素同步。

If you're a fan of jQuery, you can use jQuery UI to do much of this for you ( example ). 如果您是jQuery的爱好者,则可以使用jQuery UI为您做很多事情( 例如 )。

I'm not expert in CSS but i think you 'll have to do something like that 我不是CSS方面的专家,但我认为您必须做类似的事情

#myDivID
{
-moz-border-radius-bottomleft: 6px;
-moz-border-radius-bottomright: 6px;
-webkit-border-bottom-left-radius: 6px;
-webkit-border-bottom-right-radius: 6px;
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
}

I hope this help you 希望对您有帮助

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

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