<分区>
<分区>
.img {
width: 200px;
height: 150px;
display: block;
background-position: 50% 50%;
background-repeat: no-repeat;
margin: 0px auto;
background-size: contain;
}
<div>
<a href="#" draggable="false">
<div class="img" style="background-image:url('http://i.imgur.com/tI5jq2c.jpg');">
</div>
<div class="caption" draggable="false" style="height: 150px;overflow: auto;">
<h3>
Title
</h3>
<p>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).</p>
</div>
</a>
</div>
当我尝试通过单击它拖动的滚动条来滚动 div 时。我搜索并找到了 draggable="false"部分,但它仅适用于图像。
我该如何解决这个问题?
最佳答案
关于html - 当在 <a> 标签内时,可滚动的 <div> 变得可拖动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46340581/