简体   繁体   English

html/css 表格中的边框半径

[英]border-radius on table in html/css

I would like a rounded border on my table's outer border.我想在我的桌子的外边框上有一个圆形边框。 However, it does not appear that anything that I am trying is working.但是,我正在尝试的任何事情似乎都没有奏效。 Any advise would be appreciated.任何建议将不胜感激。 What is perhaps more odd is that the code seems to work when I 'run' in stackoverflow, but does not work on my actual source code.更奇怪的是,当我在 stackoverflow 中“运行”时,代码似乎可以工作,但在我的实际源代码上却不起作用。 I'm not sure if that is because I'm using Hugo as a platform?我不确定这是不是因为我使用 Hugo 作为平台? All of my other border-radius functions seem to work...我所有的其他边界半径功能似乎都有效......

RELEVANT CODE相关代码

 .table-bor { border: solid; border-width: 1px; border-color: $theme; padding: 50px 30px; margin-top: 50px; margin-bottom: 50px; margin-left: 30px; border-radius: 10px; } /* not relevant */ .title-borrow { text-align: right; color: $theme; font-size: 30pt; } /* I HAVE ALSO TRIED THE FOLLOWING BUT IT DID NOT WORK */ td:first-of-type { border-top-left-radius: 10px; } th:last-of-type { border-top-right-radius: 10px; } tr:last-of-type td:first-of-type { border-bottom-left-radius: 10px; } tr:last-of-type td:last-of-type { border-bottom-right-radius: 10px; } /* AND IN THE ACTUAL HTML CODE, I HAVE TRIED THE FOLLOWING INDIVIDUALLY */ <table style="border-radius: 10px !important"> <table style="border-radius: 10px"> /* in first tr & th */ <tr style="border-top-left-radius: 10px"> <th style="border-top-left-radius: 10px">
 <table class="table-bor"> <tr> <th class="title-borrow">Test</th> <td></td> </tr> <tr> <td class="calc-input">Amount of the loan ($):</td> <td><input id="amount" placeholder="$300 - $2,500" onclick="calculate(this);"></td> </tr> <!-- ... --> </table>

Check in your browsers inspector to see if something is overriding the style.检查您的浏览器检查器,看看是否有什么东西覆盖了样式。 As well your inspector should be able to show all of the css attributes being applied to any element so you can see what elements are actually being applied.同样,您的检查员应该能够显示应用于任何元素的所有 css 属性,以便您可以查看实际应用了哪些元素。

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

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