【问题标题】:What is the difference between no-drop and not-allowed in CSS?CSS中的no-drop和not-allowed有什么区别?
【发布时间】:2015-04-28 06:34:58
【问题描述】:

我很惊讶地发现“no-drop”和“not-allowed”的光标样式在 CSS 中本质上是相同的。那么,为什么我们都需要它们呢?

【问题讨论】:

    标签: html css stylesheet


    【解决方案1】:

    虽然它们可能在大多数系统上产生相同的效果,但它们在语义上是不同的,允许浏览器和/或系统为每种情况实现不同的图形。 no-drop 表示该元素未实现拖放 API,而 not-allowed 是通用术语,表示该元素未启用某些操作。

    div {
      padding: 5px;
      margin: 5px;
    }
    
    pre {
      display: inline-block;
      background-color: #DDDDDD;
    }
    
    .no-drop {
      background-color: #DD22DD;
      cursor: no-drop;
    }
    
    .not-allowed {
      background-color: #DDDD22;
      cursor: not-allowed;
    }
    <div class="no-drop">This area displays the <pre>no-drop</pre> cursor.</div>
    
    <div class="not-allowed">This area displays the <pre>not-allowed</pre> cursor.</div>

    【讨论】:

      【解决方案2】:

      显然这是 Firefox 中的一个错误:https://bugzilla.mozilla.org/show_bug.cgi?id=275173。它们在 Internet Explorer 中有所不同。 No-drop 是指旁边有不允许的牌。见http://www.worldtimzone.com/mozilla/testcase/css3cursors.html

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-08-12
        • 1970-01-01
        • 2015-09-18
        • 2011-11-26
        • 2011-08-26
        • 1970-01-01
        • 1970-01-01
        • 2016-05-01
        相关资源
        最近更新 更多