\t\t\t\t\t            <\/div>\t\t\t\t\t\t
\t\t\t\t\t\t\t

 <\/h1>\t\t\t\t

 <\/h2>\t\t\t\t\t\t\t\t<\/nav>\t\t\t\t\t\t\t<\/header>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSelect Contact<\/span>\t\t\t\t\t    \t\t\t\t\t        
  • \t\t\t\t        \t
    \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tEd Bradley<\/option>\t\t\t\t\t\t\t\t\t\tContact2<\/option>\t\t\t\t\t\t\t\t\t\tContact3<\/option>\t\t\t\t\t\t\t\t\t<\/select>\t\t\t\t\t\t\t\t<\/form>                            \t<\/a>                            <\/li>\t\t\t\t\t        
  • \t\t\t\t        \t\t\t\t\t\t\t\t\t\t        \t\t\t\t\t\t\t\tSelect a Saved List<\/option>\t\t\t\t\t\t\t\t\t\tList1<\/option>\t\t\t\t\t\t\t\t\t\tList2<\/option>\t\t\t\t\t\t\t\t\t\tList3<\/option>\t\t\t\t\t\t\t\t\t<\/select>\t\t\t\t\t\t\t\t<\/form>                            \t<\/a>                            <\/li>                            
  • Active Search - 200 Contacts<\/a><\/li>\t\t\t\t\t        
  • All Contacts - 70000 Contacts<\/a><\/li>\t\t\t\t\t    <\/ul>\t\t\t\t\t<\/div>\t\t\t\t?<\/div>\t\t\t<\/section>\t\t\t        <\/div>\t\t       

    国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

    目錄
    回復討論(解決方案)
    首頁 web前端 html教學 求教:如何在一個drop down list 內部 再嵌套另一個drop down list 并取值_html/css_WEB-ITnose

    求教:如何在一個drop down list 內部 再嵌套另一個drop down list 并取值_html/css_WEB-ITnose

    Jun 24, 2016 pm 12:19 PM

    最近在web?前臺(front-end)開發(fā)時遇到一個技術問題,但沒查到解決方法,想請教一下:在web?客戶端(client?side)如何實現(xiàn)在一個“父?(parent)"?drop?down?list內部?再嵌套另一個”子(child)“drop?down?list?并將子下拉菜單取值后的內容傳給上一級下拉菜單后輸出


    回復討論(解決方案)

    1.外層的drop?down?list?通過其他元素如div去模擬
    2.重新設計使之更合理?這種情況可以像常見的選擇了省份在選擇市之類的關聯(lián)選擇那樣選擇

    多謝樓上的朋友。由于我經驗很有限,不知能否提供一些實例,或給個鏈接參考一下。

    謝先!

    現(xiàn)在遇到的情況是這樣的:
    (1)在firefox上運行異常;
    (2)子(child)dropdownlist中取的值,不知如何賦給上一dropdownlist(即由css,div模擬的那個parent?dropdownlist)

    練習源代碼如下:

    demo.html

    <!DOCTYPE html><html lang="en">    <head>		<meta charset="UTF-8" />        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 		<meta name="viewport" content="width=device-width, initial-scale=1.0">         <title>Custom Drop-Down List Styling</title>        <link rel="stylesheet" type="text/css" href="style.css" />        <link  rel='stylesheet' type='text/css' />		<script type="text/javascript" src="modernizr.custom.79639.js"></script> 		<noscript><link rel="stylesheet" type="text/css" href="noJS.css" /></noscript>        </head>    <body>        <div class="container">					<!-- Codrops top bar -->            <div class="codrops-top"></div><!--/ Codrops top bar -->						<header>							<h1> </h1>				<h2> </h2>								<nav class="codrops-demos"></nav>							</header>						<section class="main">				<div class="wrapper-demo">					<div id="dd" class="wrapper-dropdown-1" tabindex="1">						<span>Select Contact</span>					    <ul class="dropdown" tabindex="1">					        <li><a href="#">				        	<form>									<select id="myselect">										<option value="1">Ed Bradley</option>										<option value="2">Contact2</option>										<option value="3">Contact3</option>									</select>								</form>                            	</a>                            </li>					        <li><a href="#">				        	<form>									<select id="myselect">        								<option value="0">Select a Saved List</option>										<option value="1">List1</option>										<option value="2">List2</option>										<option value="3">List3</option>									</select>								</form>                            	</a>                            </li>                            <li><a href="#">Active Search - 200 Contacts</a></li>					        <li><a href="#">All Contacts - 70000 Contacts</a></li>					    </ul>					</div>				?</div>			</section>			        </div>		<!-- jQuery if needed -->       <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>		<script type="text/javascript">						function DropDown(el) {				this.dd = el;				this.placeholder = this.dd.children('span');				this.opts = this.dd.find('ul.dropdown > li');				this.val = '';				this.index = -1;				this.initEvents();			}			DropDown.prototype = {				initEvents : function() {					var obj = this;					obj.dd.on('click', function(event){						$(this).toggleClass('active');						return false;					});					obj.opts.on('click',function(){						var opt = $(this);						obj.val = opt.text();						obj.index = opt.index();						obj.placeholder.text('Select Contact: ' + obj.val);					});				},				getValue : function() {					return this.val;				},				getIndex : function() {					return this.index;				}			}			$(function() {				var dd = new DropDown( $('#dd') );				$(document).click(function() {					// all dropdowns					$('.wrapper-dropdown-1').removeClass('active');				});			});					</script>	</body></html>


    style.css

    @import url('demo.css');@import url('font-awesome.css');/* GLOBALS */*,*:after,*:before {    -webkit-box-sizing: border-box;    -moz-box-sizing: border-box;    box-sizing: border-box;    padding: 0;    margin: 0;}::selection {    background: transparent; }::-moz-selection {    background: transparent; }.wrapper-demo {    margin: 60px 0 0 0;    *zoom: 1;    font-weight: 400;}.wrapper-demo:after {    clear: both;    content: "";    display: table;}/* DEMO 1 */.wrapper-dropdown-1 {    /* Size and position */    position: relative; /* Enable absolute positionning for children and pseudo elements */    width: 400px;    padding: 10px;    margin: 0 auto;    /* Styles */    background: #9bc7de;    color: #fff;    outline: none;    cursor: pointer;    /* Font settings */    font-weight: bold;}.wrapper-dropdown-1:after {    content: "";    width: 0;    height: 0;    position: absolute;    right: 16px;    top: 50%;    margin-top: -6px;    border-width: 6px 0 6px 6px;    border-style: solid;    border-color: transparent #fff;    }.wrapper-dropdown-1 .dropdown {    /* Size & position */    position: absolute;    top: 100%;    left: 0;    right: 0;    /* Styles */    background: #fff;    list-style: none;    font-weight: normal; /* Cancels previous font-weight: bold; */    /* Hiding */    opacity: 0;    pointer-events: none;}.wrapper-dropdown-1 .dropdown li a {    display: block;    text-decoration: none;    color: #9e9e9e;    padding: 10px 20px;}/* Hover state */.wrapper-dropdown-1 .dropdown li:hover a {    background: #f3f8f8;}/* Active state */.wrapper-dropdown-1.active .dropdown {    opacity: 1;    pointer-events: auto;}.wrapper-dropdown-1.active:after {    border-color: #9bc7de transparent;    border-width: 6px 6px 0 6px ;    margin-top: -3px;}.wrapper-dropdown-1.active {  background: #9bc7de;  background: -moz-linear-gradient(left,  #9bc7de 0%, #9bc7de 78%, #ffffff 78%, #ffffff 100%);  background: -webkit-gradient(linear, left top, right top, color-stop(0%,#9bc7de), color-stop(78%,#9bc7de), color-stop(78%,#ffffff), color-stop(100%,#ffffff));  background: -webkit-linear-gradient(left,  #9bc7de 0%,#9bc7de 78%,#ffffff 78%,#ffffff 100%);  background: -o-linear-gradient(left,  #9bc7de 0%,#9bc7de 78%,#ffffff 78%,#ffffff 100%);  background: -ms-linear-gradient(left,  #9bc7de 0%,#9bc7de 78%,#ffffff 78%,#ffffff 100%);  background: linear-gradient(to right,  #9bc7de 0%,#9bc7de 78%,#ffffff 78%,#ffffff 100%);  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#9bc7de', endColorstr='#ffffff',GradientType=1 );}/* No CSS3 support */.no-opacity       .wrapper-dropdown-1 .dropdown,.no-pointerevents .wrapper-dropdown-1 .dropdown {    display: none;    opacity: 1; /* If opacity support but no pointer-events support */    pointer-events: auto; /* If pointer-events support but no pointer-events support */}.no-opacity       .wrapper-dropdown-1.active .dropdown,.no-pointerevents .wrapper-dropdown-1.active .dropdown {    display: block;}


    demo.css
    /* General Demo Style */body {	font-family: 'Lato', 'Arial', sans-serif;	background: #ddd url(../images/bg.jpg);	font-weight: 300;	font-size: 15px;	color: #333;	-webkit-font-smoothing: antialiased;	overflow-y: scroll;	overflow-x: hidden;}a {	color: #555;	text-decoration: none;}.container {	width: 100%;	position: relative;}.clr {	clear: both;	padding: 0;	height: 0;	margin: 0;}.main {	width: 90%;	margin: 0 auto;	position: relative;}.container > header {	margin: 10px;	padding: 20px 10px 10px 10px;	position: relative;	display: block;	text-shadow: 1px 1px 1px rgba(0,0,0,0.2);    text-align: center;}.container > header h1 {	font-size: 30px;	line-height: 38px;	margin: 0;	position: relative;	font-weight: 300;	color: #666;	text-shadow: 1px 1px 1px rgba(255,255,255,0.7);}.container > header h2 {	font-size: 14px;	font-weight: 300;	margin: 0;	padding: 15px 0 5px 0;	color: #888;	font-family: Cambria, Georgia, serif;	font-style: italic;	text-shadow: 1px 1px 1px rgba(255,255,255,0.9);}/* Header Style */.codrops-top {	line-height: 24px;	font-size: 11px;	background: #fff;	background: rgba(255, 255, 255, 0.5);	text-transform: uppercase;	z-index: 9999;	position: relative;	font-family: Cambria, Georgia, serif;	box-shadow: 1px 0px 2px rgba(0,0,0,0.2);}/* Clearfix hack by Nicolas Gallagher: http://nicolasgallagher.com/micro-clearfix-hack/ */.codrops-top:before,.codrops-top:after {    content: " "; /* 1 */    display: table; /* 2 */}.codrops-top:after {    clear: both}.codrops-top a {	padding: 0px 10px;	letter-spacing: 1px;	color: #333;	display: inline-block;}.codrops-top a:hover {	background: rgba(255,255,255,0.6);}.codrops-top span.right {	float: right;}.codrops-top span.right a {	float: left;	display: block;}/* Demo Buttons Style */.codrops-demos {    text-align:center;	display: block;	line-height: 30px;	padding: 5px 0px;}.codrops-demos a {    display: inline-block;	margin: 0px 4px;	padding: 0px 6px;	color: #aaa;	line-height: 20px;		font-size: 12px;	font-weight: 700;	text-shadow: 1px 1px 1px #fff;	border: 1px solid #fff;	background: #ffffff; /* Old browsers */	background: -moz-linear-gradient(top, #ffffff 0%, #f6f6f6 47%, #ededed 100%); /* FF3.6+ */	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(47%,#f6f6f6), color-stop(100%,#ededed)); /* Chrome,Safari4+ */	background: -webkit-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* Chrome10+,Safari5.1+ */	background: -o-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* Opera 11.10+ */	background: -ms-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* IE10+ */	background: linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* W3C */	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ededed',GradientType=0 ); /* IE6-9 */	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);}.codrops-demos a:hover {	color: #333;	background: #fff;}.codrops-demos a:active {	background: #fff;}.codrops-demos a.current-demo,.codrops-demos a.current-demo:hover {	background: #f0f0f0;	border-color: #d9d9d9;	color: #aaa;	box-shadow: 0 1px 0 rgba(255,255,255,0.3);	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f6f6f6', endColorstr='#f6f6f6',GradientType=0 ); /* IE6-9 */}.support-note span {	color: #ac375d;	font-size: 16px;	display: none;	font-weight: bold;	text-align: center;	padding: 5px 0;}.no-cssanimations .support-note span.no-cssanimations,.no-csstransforms .support-note span.no-csstransforms,.no-csstransforms3d .support-note span.no-csstransforms3d,.no-csstransitions .support-note span.no-csstransitions {	display: block;}


    noJS.css
    /* DEMO 1 */.wrapper-dropdown-1:focus .dropdown {    opacity: 1;    pointer-events: auto;}.wrapper-dropdown-1:focus:after {    border-color: #9bc7de transparent;    border-width: 6px 6px 0 6px ;    margin-top: -3px;}

    本網站聲明
    本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發(fā)現(xiàn)涉嫌抄襲或侵權的內容,請聯(lián)絡admin@php.cn

    熱AI工具

    Undress AI Tool

    Undress AI Tool

    免費脫衣圖片

    Undresser.AI Undress

    Undresser.AI Undress

    人工智慧驅動的應用程序,用於創(chuàng)建逼真的裸體照片

    AI Clothes Remover

    AI Clothes Remover

    用於從照片中去除衣服的線上人工智慧工具。

    Clothoff.io

    Clothoff.io

    AI脫衣器

    Video Face Swap

    Video Face Swap

    使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

    熱工具

    記事本++7.3.1

    記事本++7.3.1

    好用且免費的程式碼編輯器

    SublimeText3漢化版

    SublimeText3漢化版

    中文版,非常好用

    禪工作室 13.0.1

    禪工作室 13.0.1

    強大的PHP整合開發(fā)環(huán)境

    Dreamweaver CS6

    Dreamweaver CS6

    視覺化網頁開發(fā)工具

    SublimeText3 Mac版

    SublimeText3 Mac版

    神級程式碼編輯軟體(SublimeText3)

    我如何了解最新的HTML標準和最佳實踐? 我如何了解最新的HTML標準和最佳實踐? Jun 20, 2025 am 08:33 AM

    要跟上HTML標準和最佳實踐,關鍵在於有意為之而非盲目追隨。首先,關注官方來源如WHATWG和W3C的摘要或更新日誌,了解新標籤(如)和屬性,將其作為參考解決疑難問題;其次,訂閱可信的網頁開發(fā)新聞通訊和博客,每週花10-15分鐘瀏覽更新,關注實際用例而非僅收藏文章;再次,使用開發(fā)者工具和linters如HTMLHint,通過即時反饋優(yōu)化代碼結構;最後,與開發(fā)者社區(qū)互動,分享經驗並學習他人實戰(zhàn)技巧,從而持續(xù)提升HTML技能。

    如何使用元素來表示文檔的主要內容? 如何使用元素來表示文檔的主要內容? Jun 19, 2025 pm 11:09 PM

    使用標籤的原因是提升網頁的語義化結構和可訪問性,使屏幕閱讀器和搜索引擎更易理解頁面內容,並允許用戶快速跳轉至核心內容。以下是關鍵要點:1.每個頁面應僅包含一個元素;2.不應包括跨頁面重複的內容(如側邊欄或頁腳);3.可與ARIA屬性結合使用以增強無障礙體驗。通常位於和之後、之前,用於包裹唯一的頁面內容,例如文章、表單或產品詳情,並應避免嵌套在、或中;為提高輔助功能,可使用aria-labelledby或aria-label明確標識部分。

    如何創(chuàng)建基本的HTML文檔? 如何創(chuàng)建基本的HTML文檔? Jun 19, 2025 pm 11:01 PM

    要創(chuàng)建一個基本的HTML文檔,首先需要了解其基本結構並按照標準格式編寫代碼。 1.開始時使用聲明文檔類型;2.使用標籤包裹整個內容;3.在其中包含和兩個主要部分,用於存放元數(shù)據(jù)如標題、樣式錶鍊接等,而則包含用戶可見的內容如標題、段落、圖片和鏈接;4.保存文件為.html格式並在瀏覽器中打開查看效果;5.隨後可逐步添加更多元素以豐富頁面內容。遵循這些步驟即可快速構建一個基礎網頁。

    如何使用 如何使用 Jun 19, 2025 pm 11:41 PM

    要創(chuàng)建HTML複選框,需使用type屬性設為checkbox的元素。 1.基本結構包含id、name和label標籤,確保點擊文字可切換選項;2.多個相關複選框應使用相同name但不同value,並用fieldset包裹提升可訪問性;3.自定義樣式時隱藏原生控件並用CSS設計替代元素,同時保持功能完整;4.確保可用性,配對label、支持鍵盤導航且避免僅依賴視覺提示。以上步驟能幫助開發(fā)者正確實現(xiàn)兼具功能與美觀的複選框組件。

    如何最小化HTML文件的大?。? />
								</a>
								<a href=如何最小化HTML文件的大??? Jun 24, 2025 am 12:53 AM

    要減小HTML文件大小需清理冗余代碼、壓縮內容并優(yōu)化結構。1.刪除未使用的標簽、注釋和多余空白以減少體積;2.將內聯(lián)CSS和JavaScript移至外部文件并合并多個腳本或樣式塊;3.在不影響解析的前提下簡化標簽語法,如省略可選閉合標簽或使用簡短屬性;4.清理后啟用Gzip或Brotli等服務器端壓縮技術進一步縮減傳輸體積。這些步驟可在不犧牲功能的前提下顯著提升頁面加載性能。

    隨著時間的流逝,HTML如何發(fā)展,其歷史上的關鍵里程碑是什麼? 隨著時間的流逝,HTML如何發(fā)展,其歷史上的關鍵里程碑是什麼? Jun 24, 2025 am 12:54 AM

    htmlhasevolvedscreatscreationtomeetthegrowingdemandsofwebdevelopersandusers.inatelyallyasimplemarkuplanguageforsharingdocuments,ithasundergonemajorupdates,包括html.2.0,包括wheintrodistusefforms;

    如何使用元素代表文檔或部分的頁腳? 如何使用元素代表文檔或部分的頁腳? Jun 25, 2025 am 12:57 AM

    是HTML5中用於定義頁面或內容區(qū)塊底部的語義化標籤,通常包含版權信息、聯(lián)繫方式或導航鏈接等;它可置於頁面底部或嵌套在、等標籤內作為區(qū)塊尾部;使用時應注意避免重複濫用及放入無關內容。

    如何使用元素將視頻嵌入HTML中? 如何使用元素將視頻嵌入HTML中? Jun 20, 2025 am 10:09 AM

    要在HTML中嵌入視頻,需使用標籤並指定視頻源與屬性。 1.使用src屬性或元素定義視頻路徑和格式;2.添加controls、width、height等基本屬性;3.為兼容不同瀏覽器,可列舉MP4、WebM、Ogg等多種格式;4.使用controls、autoplay、muted、loop、preload等屬性控製播放行為;5.通過CSS實現(xiàn)響應式佈局,確保適配不同屏幕。正確結構與屬性組合能確保視頻良好顯示與功能支持。

    See all articles
    1. <rt id="spoj4"><small id="spoj4"></small></rt>