gpt4 book ai didi

html - 在html,css中重叠城市下拉菜单

转载 作者:太空宇宙 更新时间:2023-11-04 12:31:56 24 4
gpt4 key购买 nike

我有 2 个下拉菜单,州和城市。选择州,特定的城市下拉列表就会显示出来。但是所有的城市下拉菜单都没有重叠,弄乱了外观。我需要一种方法来重叠所有城市下拉列表。

下面是简化的 html,我需要添加什么来解决这个问题?

我需要在这部分(城市)添加一些 CSS style="height: 30px;__something here___"

<select class="input-txt" style="height: 30px;" name="Standard"
onchange="showDiv(this.value);">
<option selected="selected">
Select
</option>

<option value="ap-adilabad">
Adilabad
</option>

将 HTML 缩减到下面 1

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<title></title>
</head>

<body>
<div class="title">
Need some support? Get in touch with our authorized service centers...
</div>

<table class="responsive-table" style=
"width: 100%; border-width: 0; border-spacing: 0; margin: 0 auto;">
<tbody>
<tr>
<td style="text-align: left; vertical-align: top;">
<div class="fix"></div>

<table style=
"width: 100%; border-width: 0; border-spacing: 0; margin: 0 auto;">
<tbody>
<tr>
<td class="responsive-td1" style="width: 39%;">
<h2>Select State</h2>
</td>

<td class="responsive-td2" style="width: 5%;"></td>

<td>
<h2>Select City</h2>
</td>
</tr>

<tr>
<td class="responsive-td3"><select class="input-txt" style=
"height: 30px;" name="search" onchange="showS(this.selectedIndex)">
<option selected="selected" value="0">
Select
</option>

<option value="andhra">
Andhra Pradesh
</option>

<option value="assam">
Assam
</option>

</td>

<td style="width: 4%;"></td>

<td class="responsive-td4">
<div id="containerSelect">
<select class="input-txt" style="height: 30px;" name="Select">
<option selected="selected">
Select
</option>
</select> <!--Andhra Pradesh-->
<select class="input-txt" style="height: 30px;" name="Standard"
onchange="showDiv(this.value);">
<option selected="selected">
Select
</option>

<option value="ap-adilabad">
Adilabad
</option>

<option value="ap-anantapur">
Anantapur
</option>
</select> <!--Assam-->
<select class="input-txt" style="height: 30px;position:absolute" name="Standard"
onchange="showDiv(this.value);">
<option selected="selected">
Select
</option>

<option value="as1">
Guwahati
</option>

</select> <!--BIHAR-->

</div>
</td>
</tr>
</tbody>
</table>&nbsp;

<div id="SkiDiv">
</div>
</td>
</tr>
</tbody>
</table>
</body>
</html>

最佳答案

您最初希望为所有城市下拉列表设置“display: none”,然后,当您选择一个州时,showS 可以将适当的城市下拉列表设置为“显示:内联 block ”。

关于html - 在html,css中重叠城市下拉菜单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27581542/

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