<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>custom js select</title>
<style type="text/css">
* { margin:0;padding:0;border:0 none;font-family:arial,helvetica,sans-serif;}
body { padding:10px;}
#current,#options { border:1px solid #999;}
#replace {cursor:default;overflow:visible;position:relative;}
#current { background:url("http://lab.aspektas.com/select/dropdown.png") right center no-repeat;margin-bottom:0;}
#current,#replace,#options li { width:300px;}
#options { border-top:0 none; display:none;list-style-type:none;margin-top:0;position:absolute;width:310px;}
#current,#options li {padding:5
select下拉框在IE和火狐下样式问题
最新推荐文章于 2021-06-03 13:02:53 发布
本文通过示例代码展示了如何使用自定义样式和JavaScript来解决IE和Firefox浏览器中select下拉框样式不一致的问题。通过隐藏原生的select元素,创建一个具有相同行为的替换元素,实现了在不同浏览器间保持一致的视觉效果。
摘要由CSDN通过智能技术生成