html - 当在 <a> 标签内时,可滚动的 <div> 变得可拖动

标签 html css

<分区>

.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"部分,但它仅适用于图像。

我该如何解决这个问题?

最佳答案

也许你可以在 <p> 上使用一些 CSS元素。

THIS LINK他们给出了一个明确的例子。

我希望我能帮上一点忙:)

最好的问候, 季米塔尔·格奥尔基耶夫

关于html - 当在 <a> 标签内时,可滚动的 <div> 变得可拖动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46340581/

上一篇:html - 如何在垂直网站中使 div 部分响应

下一篇:javascript - 进度条倒计时不起作用

相关文章:

css - 仅使用伪元素创建 css 徽章

javascript - Recaptcha 无效请求 cookie

html - 如何使动态文本将自身限制在某个点?

html - 仅当滚动到底部时才将页脚固定到底部

html - 带有文本和文本图标的样式选项标签

html - 如何相对于另一个元素静态定位 HTML 元素?

javascript - 在 mozilla 和 chrome 中更改我的图像的位置

javascript - 如何使用 Javascript 查找所有出现的特定 nth-child() 元素

html - 单选按钮 CSS 显示隐藏 div 没有 jQuery

html - 为什么 Twitter Bootstrap 会破坏我的 CSS 布局?