gpt4 book ai didi

css - -webkit-user-drag css 属性是什么?

转载 作者:技术小花猫 更新时间:2023-10-29 12:07:40 25 4
gpt4 key购买 nike

我已经在几个地方看到过这个,但是找不到太多关于它的信息:

-webkit-user-drag: element

这是 HTML5 拖放标准的一部分吗?这比使用属性版本好/坏吗:

<div draggable="true">my draggable element</div>

编辑:我熟悉当前规范并使用 draggable 属性,我不清楚的是 CSS 属性 *-user-drag。

最佳答案

这是一个特定于 Webkit 的属性。这是the WebKit documentation说:

Making an Element Draggable

WebKit provides automatic support to let users drag common items, such as images, links, and selected text. You can extend this support to include specific elements on an HTML page. For example, you could mark a particular div or span tag as draggable.

To mark an arbitrary element as draggable, add the -webkit-user-drag attribute to the style definition of the element. Because -webkit-user-drag is a cascading style sheet (CSS) attribute, you can include it as part of a style definition, or as an inline style attribute on the element tag. The values for this attribute are listed in Table 4-1.

Values for -webkit-user-drag attribute:

  • none: Do not allow this element to be dragged.

  • element: Allow this element to be dragged.

  • auto: Use the default logic for determining whether the element should be dragged. (Images, links, and text selections are the only elements that can be dragged.) This is the default value.

所有使用 WebKit 渲染引擎的浏览器都支持它,例如 Chrome、更新版本的 Opera、Safari 等。使用 WebKit 的移动浏览器的支持可能因移动操作系统而异。

关于css - -webkit-user-drag css 属性是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15034842/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com