課程
/前端開發(fā)
/HTML/CSS
/初識HTML(5)+CSS(3)-升級版
怎么改變下拉列表的位置
2016-12-27
源自:初識HTML(5)+CSS(3)-升級版 6-10
正在回答
具體你可以自己去學習下HTML+CSS中的第11章到15章,里面講的很詳細,一看就懂,比你在這里就這么提了一個不明確的問題強的多,他能告訴你想要的
<!DOCTYPE?html> <head> <meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8"?/> <title>div模擬select下拉菜單</title> <style?type="text/css"> ????.mod_select{position:absolute;left:30%;top:100px;font-familY:Arial,?Helvetica,?sans-serif;} ????.mod_select?ul{margin:0;padding:0;} ????.mod_select?ul?li{list-style-type:none;float:left;margin-left:20px;height:24px;} ????.select_label{color:#982F4D;float:left;line-height:24px;padding-right:10px;font-size:12px;font-weight:700;} ????.select_box{float:left;border:solid?1px?#EDE7D6;color:#444;position:relative;cursor:pointer;width:165px;background:url()?repeat-x;font-size:12px;} ????.selet_open{display:inline-block;border-left:solid?1px?#E5E5E5;position:absolute;right:0;top:0;width:30px;height:24px;background:url()?no-repeat?center?center;} ????.select_txt{display:inline-block;padding-left:10px;width:135px;line-height:24px;height:24px;cursor:text;overflow:hidden;} ????.option{width:165px;;border:solid?1px?#EDE7D6;position:absolute;top:24px;left:-1px;z-index:2;overflow:hidden;display:none;} ????.option?a{display:block;height:26px;line-height:26px;text-align:left;padding:0?10px;width:100%;background:#fff;} ????.option?a:hover{background:#FDE0E5;} </style> <script?src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"?type="text/javascript"></script> <script?type="text/javascript"> ????$(document).ready(function(){ ????????????$(".select_box").click(function(event){??? ????????????????event.stopPropagation(); ????????????????$(this).find(".option").toggle(); ????????????????$(this).parent().siblings().find(".option").hide(); ????????????}); ????????????$(document).click(function(event){ ????????????????var?eo=$(event.target); ????????????????if($(".select_box").is(":visible")?&&?eo.attr("class")!="option"?&&?!eo.parent(".option").length) ????????????????$('.option').hide();?????????????????????????????????????? ????????????}); ????????????/*賦值給文本框*/ ????????????$(".option?a").click(function(){ ????????????????var?value=$(this).text(); ????????????????$(this).parent().siblings(".select_txt").text(value); ????????????????$("#select_value").val(value) ?????????????}) ????????}) </script> </head> <body> <div?class="mod_select"> ????<ul> ????????<li> ????????????<span?class="select_label">sort?buy:</span> ????????????<div?class="select_box"> ????????????????<span?class="select_txt"></span><a?class="selet_open"><b></b></a> ????????????????<div?class="option"> ????????????????????<a>1</a> ????????????????????<a>2</a> ????????????????????<a>3</a> ????????????????</div> ????????????</div> ????????????<br?clear="all"?/> ????????</li> ????<li> ????????????<span?class="select_label">View:</span> ????????????<div?class="select_box"> ????????????????<span?class="select_txt"></span><a?class="selet_open"></a> ????????????????<div?class="option"> ????????????????????<a>1</a> ????????????????????<a>2</a> ????????????????????<a>3</a> ????????????????</div> ????????????</div> ????????</li> ????</ul> ????<input?type="hidden"?id="select_value"?/> </div> </body> </html>能看懂css應該就能改了.....
<span><select></select></span>??span{line-height:..px;}
通過CSS樣式去改變下拉列表的位置,該要用什么CSS代碼去改變要看具體情況。您是想如何改變位置?
舉報
HTML(5)+CSS(3)基礎(chǔ)教程8小時帶領(lǐng)大家步步深入學習標簽用法和意義
3 回答下拉列表框
1 回答下拉列表框
2 回答下拉列表框
3 回答表單下拉列表框
3 回答怎么設(shè)置下拉列表中的雙選
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學習伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2016-12-27
具體你可以自己去學習下HTML+CSS中的第11章到15章,里面講的很詳細,一看就懂,比你在這里就這么提了一個不明確的問題強的多,他能告訴你想要的
2016-12-27
2016-12-27
2016-12-27
通過CSS樣式去改變下拉列表的位置,該要用什么CSS代碼去改變要看具體情況。您是想如何改變位置?