问题描述
我有一个包含所有类别的导航菜单
在 PC 上它与水平滚动条配合得很好,但是在智能手机上,我不得不用 CSS 隐藏滚动条
这导致现在在 PC 上它们无法滑动类别
我怎样才能让它在两者上都能工作?
.parent {
width: 100%;
height: 30px;
border: 1px solid #AAA;
white-space: Nowrap;
overflow-y: hidden;
}
.child {
height: 45px;
overflow-x: auto;
}
<div class="parent">
<div class="child">
<table id="ctl00_ContentPlaceHolder1_DataList1" cellspacing="0" border="0" style="border-collapse:collapse;">
<tbody>
<tr>
<td>
<a id="ctl00_ContentPlaceHolder1_DataList1_ctl00_hypCateg" href="Index.aspx?CodCateg=19">cat 1</a>
</td>
<td>
<a id="ctl00_ContentPlaceHolder1_DataList1_ctl01_hypCateg" href="Index.aspx?CodCateg=22">cat 2</a>
</td>
<td>
<a id="ctl00_ContentPlaceHolder1_DataList1_ctl02_hypCateg" href="Index.aspx?CodCateg=17">cat 3</a>
</td>
<td>
<a id="ctl00_ContentPlaceHolder1_DataList1_ctl03_hypCateg" href="Index.aspx?CodCateg=9">cat 23</a>
</td>
<td>
<a id="ctl00_ContentPlaceHolder1_DataList1_ctl04_hypCateg" href="Index.aspx?CodCateg=12">cat 5</a>
</td>
<td>
<a id="ctl00_ContentPlaceHolder1_DataList1_ctl05_hypCateg" href="Index.aspx?CodCateg=7">FARINA DA GRANI ANTICHI</a>
</td>
<td>
<a id="ctl00_ContentPlaceHolder1_DataList1_ctl06_hypCateg" href="Index.aspx?CodCateg=13">FRUTTA</a>
</td>
<td>
<a id="ctl00_ContentPlaceHolder1_DataList1_ctl07_hypCateg" href="Index.aspx?CodCateg=15">FUNGHI NATURALI</a>
</td>
<td>
<a id="ctl00_ContentPlaceHolder1_DataList1_ctl08_hypCateg" href="Index.aspx?CodCateg=16">MAIALE</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)