【发布时间】:2025-12-07 11:45:01
【问题描述】:
我在一个网站上工作,当在移动设备上使用时,除了下面的页面之外,它都可以正常工作。 当该菜单部分处于活动状态时,手风琴应该可以显示菜单项,但在移动设备上,当手风琴处于活动状态时内容不会显示?
http://valleyinn.ie/menus/menus.html
html
<H1> A La Carte Menu </H1>
<div class="wrapper">
<ul class="accordion">
<li class="nav-dropdown">
<input type="radio" name="accordion" id="menu 1" />
<label for="menu 1">
Starters
</label>
<div>
<h2>Starters</h2>
<p>Prawn cocktail : Clogherhead prawns coated in Marie Rose sauce served with salad</p>
<p>Garlic Bread: Garlic bread coated with mozarella cheese</p>
<p>Bruchetta: Garlic toastie with tomato, basil and melted mozzarella</p>
<p>Deep Fried Brie: Breaded parcels of Brie deep fried and served with redcurrant jelly</p>
<p> Garlic Mushrooms: Deep fried breaded mushrooms with garlic mayonnaise</p>
<P>Fan of Melon: Fan of honeydew melon served with Raspberry Coulis</P>
<p>Caesar Salad: Crispy cos tossed with bacon, croutons & creamy caesar dressing with parmesan shavings</>
<p>Soup of the Day
<p>Chicken Wings: Marinated chicken wings served with sweet chilli dip & side salad</p>
<p>Egg Mayonnaise</p>
<P>Tiger Prawns: Served with honey mustard dressing & garlic bread</P>
</div>
</li>
和css
div#title {
text-align:center;
}
body div.wrapper {
clear:both;
border: 1px solid #dedede;
margin: 25px auto;
overflow: hidden;
width: 80%;
}
ul.accordion {
list-style-type: none;
margin: 0;
padding: 0;
}
ul.accordion li input {
display: none;
padding: 0;
margin: 0;
visibility: hidden;
}
ul.accordion label {
background-color: #000000;
border-bottom: 1px solid #dedede;
box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.055);
color: #F9C921;
display: block;
font-weight: bold;
line-height: 42px;
padding: 0 8px;
}
ul.accordion label:hover {
background-color: #F9C921;
color:#000000;
cursor: pointer;
}
ul.accordion li input ~ div {
background-color: rgba( 0, 0, 0, .05 );
max-height: 0;
opacity: 0;
overflow: hidden;
visibility: hidden;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
-ms-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
ul.accordion li input ~ div p {
font-size: .9em;
margin: 16px 24px;
}
h1 {
clear:both;
}
ul.accordion li input:checked ~ div {
max-height: 100%;
opacity: 1;
visibility: visible;
}
ul.accordion li input:checked ~ div > ul {
display: block;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
-ms-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
除了制作一个我以前没有做过的移动设备特定页面之外,我想不出从哪里开始的任何可能的修复或解决方法
通过更改代码来避免问题解决。
【问题讨论】:
-
它不适用于我尝试过的任何移动浏览器,例如 chrome 和 safari,我正在尝试您现在建议的所有修复,感谢您的建议,我会告诉您它是否有效
-
只是再次查看您的网站 - 我会在这些扩展选项卡中使用表格,这样您就可以拥有菜肴的标题、描述,也许还有价格?
-
决定只使用一点 javascript 而没有 ios 的下拉菜单让事情变得更容易我认为