gpt4 book ai didi

jquery - 使用 css 下拉选择屏幕出现错误

转载 作者:行者123 更新时间:2023-11-28 17:39:54 25 4
gpt4 key购买 nike

我尝试制作 css 选择框,但是当我尝试使用 firefox 时,我变得不同了。但是choroe很好。我需要在 CSS 后面添加什么才能显示漂亮的屏幕?

您可以在 jsfiddle 上显示

我为选择器错误放置了打印屏幕 img

html

<label>
<select>
<option selected> Select Box </option>
<option>Short Option</option>
<option>This Is A Longer Option</option>
</select>
</label>

CSS

body, html {background:#444; text-align:center; padding:50px 0;}

/* The CSS */
select {
padding:3px;
margin: 0;
-webkit-border-radius:4px;
-moz-border-radius:4px;
border-radius:4px;
-webkit-box-shadow: 0 3px 0 #ccc, 0 -1px #fff inset;
-moz-box-shadow: 0 3px 0 #ccc, 0 -1px #fff inset;
box-shadow: 0 3px 0 #ccc, 0 -1px #fff inset;
background: #f8f8f8;
color:#888;
border:none;
outline:none;
display: inline-block;
-webkit-appearance:none;
-moz-appearance:none;
appearance:none;
cursor:pointer;
}

/* Targetting Webkit browsers only. FF will show the dropdown arrow with so much padding. */
@media screen and (-webkit-min-device-pixel-ratio:0) {
select {padding-right:18px}
}

label {position:relative}
label:after {
content:'<>';
font:11px "Consolas", monospace;
color:#aaa;
-webkit-transform:rotate(90deg);
-moz-transform:rotate(90deg);
-ms-transform:rotate(90deg);
transform:rotate(90deg);
right:8px; top:2px;
padding:0 0 2px;
border-bottom:1px solid #ddd;
position:absolute;
pointer-events:none;
}
label:before {
content:'';
right:6px; top:0px;
width:20px; height:20px;
background:#f8f8f8;
position:absolute;
pointer-events:none;
display:block;
}

最佳答案

添加文本溢出

select {
-moz-appearance: none;
text-indent: 0.01px;
text-overflow: '';
}

关于jquery - 使用 css 下拉选择屏幕出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24339336/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com