html - 是什么导致 border-radius 不起作用?

标签 html css

<分区>

我已经在 Chrome 和 Firefox 中对此进行了测试。我试图在我的 table 上制作轻微的圆 Angular 边缘,但我不明白为什么 border-radius 命令不起作用。

这是 jfiddle:

http://jsfiddle.net/hz018pLz/

当我使用 CTRL+SHIFT+I 查看计算样式时,我看到这个元素有

border-radius: 20px; 勾选,但取消选择不会改变表格的显示。

我没有做哪些事情是我需要做的才能让它发挥作用?

代码如下:

#bp-table {
  font-family: Century Gothic, sans-serif;
  font-size: 11px;
  margin: 15px;
  width: 99%;
  max-width: 99%;
  border-radius: 20px;
  border-collapse: collapse;
}
#bp-table th {
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  padding: 8px;
  background: rgb(60, 55, 88);
  color: #ffffff;
}
#bp-table td {
  padding: 8px;
  background: #e8edff;
  text-align: left;
  border-bottom: 1px solid #fff;
  border-top: 1px solid transparent;
}
#bp-table tr:hover td {
  background: #f0d3d3;
  color: #1e1e5b;
}
<table id="bp-table">
  <thead>
    <th>A</th>
    <th>B</th>
    <th>C</th>
    <th>D</th>
    <th>E</th>
  </thead>
  <tbody>
    <td>one</td>
    <td>one</td>
    <td>one</td>
    <td>one</td>
    <td>one</td>
  </tbody>
</table>

最佳答案

里面的元素仍然是矩形并且完全可见,所以你可以改变 overflow 属性来避免视觉矩形:

#bp-table {
  overflow:hidden;
}

检查 UpdatedFiddle

关于html - 是什么导致 border-radius 不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27320224/

相关文章:

javascript - 最小化窗口时标签的文本与文本区域重叠

java - 使用 HTMLUnit 访问 JavaScript 变量

asp.net - 静态宽度 DIV 旁边的动态宽度 DIV

html - 我正在尝试使用 CSS 水平显示图像

html - 删除文本和选择选项之间的空格

html - 如何使用 css 将复选框的位置设置为 td 和输入类型文本的中间?

html - DIV 不采用父级高度 3 列

html - div 中的背景图片不起作用(包括视频)

JavaScript:检查 css 规则是否应用于元素

html - 如何在导航中使用两个 float