国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術(shù)文章
文章詳情頁

css3 - selected添加 border???

瀏覽:139日期:2023-07-07 17:35:05

問題描述

selected添加 border???

css3 - selected添加 border???

問題解答

回答1:

.selected{border-bottom:2px solid rgb(255,203,107)}

回答2:

樓主,如果是用select寫的話沒辦法設(shè)置這種效果,建議樓主使用ul li寫。我是個新手,簡單寫了一下,需要改的地方還很多,如果有哪里需要改正希望各位大神指摘一下呀~ 簡單寫的,很多地方?jīng)]有做處理,比如真正模擬select框的話,input右側(cè)最好加個箭頭,可以當(dāng)作一個開關(guān)這樣子。

PS:第一次在這里粘代碼段,不知道格式是什么樣子。。。湊合看吧。

html代碼:

<p class='choose'> <input type='text' value='--select--' /> <p class='down-select'><ul> <li><a href='http://www.intensediesel.com/wenda/5852.html#'>數(shù)學(xué)</a></li> <li><a href='http://www.intensediesel.com/wenda/5852.html#'>英語</a></li> <li><a href='http://www.intensediesel.com/wenda/5852.html#'>化學(xué)</a></li> <li><a href='http://www.intensediesel.com/wenda/5852.html#'>生物</a></li></ul> </p></p>

css代碼:

* { margin: 0; padding: 0;} a { text-decoration: none; color: #666;} input.select { width: 100px; height: 30px;} p.down-select { display: none; width: 100px; box-shadow: 0 0 2px 2px #cccccc; } p.down-select ul { list-style-type: none; overflow: hidden; width: 100px; border-bottom: 2px solid #ffb200;} p.down-select ul li { line-height: 20px; border-bottom: 1px solid #cccccc; text-align: center; height: 30px; padding-top: 10px;}

js代碼:

$(’input.select’).click(function(e) { e.preventDefault(); $(’.down-select’).show();});$(’.down-select li’).click(function(e) { e.preventDefault(); var selectVal = $(this).find(’a’).text(); $(’.select’).val(selectVal); $(’.down-select’).hide();});

標(biāo)簽: CSS
相關(guān)文章:
主站蜘蛛池模板: 磴口县| 三台县| 互助| 六安市| 社会| 伊通| 德庆县| 雅江县| 济宁市| 迁西县| 托克托县| 普宁市| 靖州| 新乐市| 阜平县| 买车| 渝中区| 邓州市| 关岭| 呼伦贝尔市| 惠来县| 辉南县| 玉山县| 荣昌县| 西昌市| 静安区| 榕江县| 清丰县| 沙坪坝区| 贵州省| 岳池县| 贵港市| 合川市| 永善县| 板桥市| 错那县| 竹溪县| 突泉县| 石嘴山市| 中西区| 沧州市|