【问题标题】:HTML ugly borders around divs on click [duplicate]点击时 div 周围的 HTML 丑陋边框 [重复]
【发布时间】:2018-09-19 17:19:46
【问题描述】:

我有一个由 div 组成的导航。当你点击一个 div 时,请求的页面会被加载到另一个 div 中。

我现在的问题是,Safari 和 chrome 会在我点击的任何 div 周围制作丑陋的边框。

如何摆脱这种边界?

我已经试过了

*, *:focus, *::-moz-focus-inner, div, div:focus, div::-moz-focus-inner {
    -moz-user-select: -moz-none;
    -khtml-user-select: none;
    -webkit-user-select: none;
    -o-user-select: none;
    user-select: none;
    border: none;
    outline: none;
    -webkit-overflow-scrolling: touch;
}

但它不起作用......

【问题讨论】:

  • 分享html代码
  • @Hilfsschueler 你试过{outline: none; border:none} 吗?
  • @Vishnu 我已经尝试过以下方法:*、*:focus、*::-moz-focus-inner、div、div:focus、div::-moz-focus-inner { -moz -用户选择:-moz-none; -khtml-用户选择:无; -webkit 用户选择:无; -o-用户选择:无;用户选择:无;边框:无;大纲:无; -webkit-溢出滚动:触摸; }

标签: javascript html css angular


【解决方案1】:

使用这个...

-webkit-user-select: none; /* Safari 3.1+ */
-moz-user-select: none; /* Firefox 2+ */
-ms-user-select: none; /* IE 10+ */
user-select: none; /* Standard syntax */

【讨论】:

    【解决方案2】:

    尝试删除 CSS 中的轮廓:

    .that-div {
      outline: 0;
    }
    

    (或大纲:无)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-07-10
      • 2019-12-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多