css设置table圆角边框不起作用的原因是:属性border-collapse:collapse和属性border-radius不兼容。正确方法如【border-collapse: separate;border-spacing:0】。
本文环境:windows10、css3,本文适用于所有品牌的电脑。
原因分析:
在table中设置border-radius发现不起作用,原因是border-collapse:collapse和border-radius不兼容。
(学习视频分享:css视频教程)
css:
border-collapse: separate; border-spacing: 0;
代码实现:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style> #table_wrap > table { font-size: 16px; text-align: center; margin: 0 auto; border-collapse: separate; border-spacing: 0; border: 2px #000; } table thead tr,table tbody tr { height: 50px; line-height: 50px; /*background-color: pink;*/ } table tr th:first-child,table tr td:first-child {/*设置table左边边框*/ border-left: 2px solid #eaeaea; } table tr th:last-child,table tr td:last-child {/*设置table右边边框*/ border-right: 2px solid #eaeaea; } table tr td:first-child, table tr td:nth-child(2), table tr td:nth-child(3), table tr td:last-child{/*设置table表格每列底部边框*/ border-bottom: 2px solid #eaeaea; } /*table tr:last-child td:first-child, table tr:last-child td:nth-child(2), table tr:last-child td:nth-child(3), table tr:last-child td:last-child{/!*设置table表格最后一列底部边框*!/ border-bottom: 2px solid #000; }*/ table tr th { background: #eaeaea; } table tr:first-child th:first-child { border-top-left-radius: 12px; } table tr:first-child th:last-child { border-top-right-radius: 12px; } table tr:last-child td:first-child { border-bottom-left-radius: 12px; } table tr:last-child td:last-child { border-bottom-right-radius: 12px; } </style> </head> <body> <div id="table_wrap"> <table width="800" cellspacing="0" cellpadding="0"> <thead> <tr> <th>头部1</th> <th>头部2</th> <th>头部3</th> <th>头部4</th> </tr> </thead> <tbody> <tr> <td>1内容1</td> <td>1内容2</td> <td>1内容3</td> <td>1内容4</td> </tr> <tr> <td>2内容1</td> <td>2内容2</td> <td>2内容3</td> <td>2内容4</td> </tr> <tr> <td>3内容1</td> <td>3内容2</td> <td>3内容3</td> <td>3内容4</td> </tr> </tbody> </table> </div> </body> </html>
实现效果:
相关推荐:CSS教程
以上是css设置table圆角边框不起作用是什么原因的详细内容。更多信息请关注PHP中文网其他相关文章!

在css中,可用list-style-type属性来去掉ul的圆点标记,语法为“ul{list-style-type:none}”;list-style-type属性可设置列表项标记的类型,当值为“none”可不定义标记,也可去除已有标记。

区别是:css是层叠样式表单,是将样式信息与网页内容分离的一种标记语言,主要用来设计网页的样式,还可以对网页各元素进行格式化;xml是可扩展标记语言,是一种数据存储语言,用于使用简单的标记描述数据,将文档分成许多部件并对这些部件加以标识。

在css中,可以利用cursor属性实现鼠标隐藏效果,该属性用于定义鼠标指针放在一个元素边界范围内时所用的光标形状,当属性值设置为none时,就可以实现鼠标隐藏效果,语法为“元素{cursor:none}”。

转换方法:1、给英文元素添加“text-transform: uppercase;”样式,可将所有的英文字母都变成大写;2、给英文元素添加“text-transform:capitalize;”样式,可将英文文本中每个单词的首字母变为大写。

在css中,rtl是“right-to-left”的缩写,是从右往左的意思,指的是内联内容从右往左依次排布,是direction属性的一个属性值;该属性规定了文本的方向和书写方向,语法为“元素{direction:rtl}”。

在css中,可以利用“font-style”属性设置i元素不是斜体样式,该属性用于指定文本的字体样式,当属性值设置为“normal”时,会显示元素的标准字体样式,语法为“i元素{font-style:normal}”。

在css3中,可以用“transform-origin”属性设置rotate的旋转中心点,该属性可更改转换元素的位置,第一个参数设置x轴的旋转位置,第二个参数设置y轴旋转位置,语法为“transform-origin:x轴位置 y轴位置”。


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

WebStorm Mac版
好用的JavaScript开发工具

SublimeText3 Linux新版
SublimeText3 Linux最新版

ZendStudio 13.5.1 Mac
功能强大的PHP集成开发环境

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

SublimeText3 英文版
推荐:为Win版本,支持代码提示!