html - CSS border-radius 仅围绕模态 div 窗口的一个 Angular

标签 html ruby-on-rails css sass

当我在模态 div(在我的正常内容上弹出的 div)上使用 border-radius 属性时,四个 Angular 并不都是圆的。 一个或两个 Angular 会变圆,但不是所有四个。

这是图片的链接,我还不能在 Stack Overflow 上发布图片 (注意图片的左上角) https://raw.githubusercontent.com/Randall-Coding/misc/master/border_round_err.png

我尝试过使用所有不同的跨浏览器属性进行边框舍入

  -moz-border-radius: 20px;   /* Also tried 20px 20px  */
  -webkit-border-radius: 20px;
  -o-border-radius: 20px;
  -khtml-border-radius: 20px;
  border-radius: 20px;

这是我使用 mixin 的 CSS 代码(请注意,无论是否使用 mixin,它看起来都一样)。

div.contact_window{
    background-color: white;
    /*border-radius: 20px 20px;  */  /*other way I have tried it */
    -moz-border-radius: 20px;   /* Also tried 20px 20px  */
    -webkit-border-radius: 20px;
    -o-border-radius: 20px;
    -khtml-border-radius: 20px;
    border-radius: 20px;
    border: 3px solid black;
    position:absolute;
    width: 60%;
    min-width:700px;
    max-width:800px;
    height: 520px;
    overflow:scroll;
    left:20%;
    top: 130px;
    z-index:10;
    display: none;
    display: block; /*DEBUG */
}

div.mask{
  background-color: black;
  opacity: 0.6;
  position:fixed;
  height:100%;
  width: 100%;
  z-index: 1;
  top: 0px;
  left: 0px;
  display:none;
  display:block; /*DEBUG */
}

HTML代码如下

    <div class="contact_window" id='#contact_window'>
        <%= render 'contact' %>
    </div> <!-- end div.contact_form -->

    <div class="mask">  

我正在圆我其他 div 的 Angular 落,没有任何问题。

所以我想知道是否有人遇到过这个问题和/或知道这里发生了什么?

*我使用的是 Firefox,但这也适用于我的 Chromium 浏览器。我的操作系统是 Ubuntu Linux 18.04。

*这里是 SCSS 和 HTML 文件的链接。
HTML https://github.com/Randall-Coding/misc/raw/master/index.html

CSS (SCSS) https://github.com/Randall-Coding/misc/raw/master/main.scss

edit* 当我检查元素时它仍然显示 border-radius:20px

最佳答案

您是否尝试通过简单地直接传递边界半径来实现不使用 mixin 的舍入?

除非您打算单独更改每个 Angular 的半径,否则最好只将一个值传递给将应用于每个 Angular 的 border-radius。这可以通过以下方式完成:

border-radius: 20px;

代替:

border-radius: 20px 20px;

试试这个作为你的 mixin(更清晰的命名):

@mixin border-radius($radius) {
  -moz-border-radius: $radius;
  -webkit-border-radius: $radius;
  border-radius: $radius;
}

并传递一个值

@include border-radius(20px);

关于html - CSS border-radius 仅围绕模态 div 窗口的一个 Angular ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53972765/

相关文章:

css - 居中对齐图像

html - 下拉菜单占用新空间而不是相对位置

ruby-on-rails - Rails Webpacker : Stop logging "Nothing to do"

css - 如何在 CSS 动画的不同关键帧上启动不同元素

css - 一个 CSS 文件可以优先于另一个 CSS 文件吗?

javascript - 如何将 javascript 计时器集成到倒计时以从 ruby​​ 变量进行计数?

html - 标签在动画的一部分时不会激活相关字段

javascript - 为什么 `document.getElementById(“#datepicker1” )` 找不到我的元素?

javascript - 如何在新选项卡中打开新页面并重定向当前页面

ruby-on-rails - 在 Rails 3 中将 lib 添加到 'config.autoload_paths' 不会自动加载我的模块