简体   繁体   English

圆角不适用于div内的所有角?

[英]Rounded corners not applying to all corners within div?

For some reason border-radius is not applying to all corners of the div (the grey in the screenshot).由于某种原因, border-radius不适用于 div 的所有角落(屏幕截图中的灰色)。 Is there something I'm doing wrong?有什么我做错了吗?

Also, if you notice the furthest right of my header isn't covered - I don't suppose this is an issue with Chrome?另外,如果您注意到我的标题的最右侧没有被覆盖 - 我认为这不是 Chrome 的问题吗? (I'll attach my CSS for the header too just in case). (为了以防万一,我也会为标题附上我的 CSS)。

For Rounded Corners:对于圆角:

HTML: HTML:

<div class="header"></div>
<h1 class="title">Creative Checker</h1>
<div class="row">
  <div class="col-12 col-md-10 offset-md-1">
    <div class="alert alert-success" style="display: none">
    </div>
    <div class="alert alert-danger" style="display: none">
    </div>
    <div class="row">
      <div class="col-md-12">
        <p class="text-center">
          1. Select product type:
        </p>
      </div>
    </div>
    <div class="row mb-3">
      <div class="col-lg-4">
        <button type="button" id="btn-snapshot" class="btn btn-secondary col-lg-12">Snapshot</button>
      </div>
      <div class="col-lg-4">
        <button type="button" id="btn-tmd" class="btn btn-secondary col-lg-12">TMD</button>
      </div>
      <div class="col-lg-4">
        <button type="button" id="btn-bpush" class="btn btn-secondary col-lg-12">Behavioural Push</button>
      </div>
    </div>
    <div class="row">
      <div class="col-lg-12">
        <p class="text-center">
          2. Upload folder/images:
        </p>
        <form action="server.php" class="dropzone" id="my-awesome-dropzone" onsubmit="onSubmit()">
          <!-- <select name="product-type" id="product_type">
                <option value="snapshot">
                  Snapshot
                </option>
                <option value="TMD">
                  TMD
                </option>
                <option value="b-push">
                  Behavioural Push
                </option>
              </select> -->
        </form>
      </div>
    </div>
  </div>
</div>

CSS: CSS:

.row {
  padding-top: 12px;
  padding-bottom: 15px;
  background-color: #F1F1F1;
  border-radius: 50px;
}

For Header Issue:对于标题问题:

.header {
  min-height: 100px;
  background-image: url('header_wallpaper.png');
  background-position: center;
  background-size: contain;
}

问题截图

I'm looking at your code and I also had tried it on codepen and the border-radius attribute it's working fine, even in the photo you shared it's seems like it's doing what it should do.我正在查看您的代码,我也在 codepen 上尝试过它,并且 border-radius 属性工作正常,即使在您分享的照片中,它似乎也在做它应该做的事情。 I notice that the left side of the div it's too near to the borer of the browser and that's why it's seems to not being applied to all the div.我注意到 div 的左侧太靠近浏览器的蛀虫,这就是为什么它似乎没有应用于所有 div。

First of all, I recommend you to reset the css.首先,我建议你重置css。 Because the browser itself has properties which applies to your pages by default and it could make things work weird and maybe that's what it's making your div to look like that.因为浏览器本身具有默认情况下适用于您的页面的属性,它可能会使事情变得奇怪,也许这就是使您的 div 看起来像那样的原因。 To do that, at the begining of your css file do:为此,请在 css 文件的开头执行:

*{
  margin: 0;
  padding: 0;
}

You could also add things like color or font-family inside of the reset css to apply things to the whole of the page.您还可以在重置 css 中添加colorfont-family内容,以将内容应用于整个页面。

That should solve the problem with the div and the header, if it doesn't, try to add to .row{ margin: 1px;} or something like that and .header{width:100%;} .这应该可以解决 div 和标题的问题,如果没有,请尝试添加到.row{ margin: 1px;}或类似的内容和.header{width:100%;}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM