描述:
以下代码片段用于Android/iPhone的Roundabout旋转木马。每个LI的宽度和高度均为100px x 100px
。链接位于LI的顶部。
<div data-role="content" data-theme="aa">
<ul class="roundabout-holder">
<li class="roundabout-moveable-item">
<a href="<%= url_for :action => :graph %>"> <%= label_for:link %></a></li>
<li class="roundabout-moveable-item">
<a href="<%= url_for :action => :graph %>"> <%= label_for:link %></a></li>
<li class="roundabout-moveable-item">
<a href="<%= url_for :action => :graph %>"> <%= label_for:link %></a></li>
<li class="roundabout-moveable-item">
<a href="<%= url_for :action => :graph %>"> <%= label_for:link %></a></li>
<li class="roundabout-moveable-item">
<a href="<%= url_for :action => :graph %>"> <%= label_for:link %></a></li>
</ul>
</div>
CSS
.roundabout-holder {
list-style: none;
width: 75%;
height: 10em;
margin: 1em auto;
}
.roundabout-moveable-item {
height: 100px;
width: 100px;
border: 1px dotted #999;
background-color: #f3f3f3;
font-size: 2em;
cursor: pointer;
}
当前行为: 在项目中,锚点只作为链接行为(跳转到给定的参考文献)。
期望行为: 当用户单击LI时,它应该跳转到给定的参考文献。
来自stackoverflow的相关资源
即使解决方案接近我的问题,我仍然需要找到通用解决方案。因为我不能一次性或逐个设置所有填充,因为链接标签可能随时更改。
已添加并测试如下
display:inline-block;
和 padding
然后问题就解决了,但是填充有时需要更改。