繁体   English   中英

表格边框半径不匹配 hover 背景颜色

[英]table border radius not match hover background-colour

在此处输入图像描述

当我 hover 时,背景颜色从表格边框半径中出来,当我在 hover 游标上时,表格的角会渗出,你可以检查一下

 table, td, th {border: 1px solid; text-align: center; padding: 15px; font-family:'League Gothic', sans-serif; font-size:25px; colour:green;} th, td {border-style: groove; border-color: #96D4D4;} td:hover {background-color: #5eff67; } table { border-collapse:collapse; background-color:#77fc7e; border-radius: 30px; border-style: hidden; /* hide standard table (collapsed) border */ box-shadow: 0 0 0 1px #666; /* this draws the table border */ } td{ border: 1px solid #ccc; transition: background-color 0.5s }
 <table border="1" > <tr> <td><a href=#smile >smile section</a><br></td> <td><a href=#exercise >physical activity</a><br></td> <td><a href=#sleep > sleeping habit </a><br></td> <td><a href=#eating> eating </a><br></td> </tr> <tr> <td><a href=#grateful> greatful </a> </td> <td><a href=#providing> providing </a> </td> <td><a href=#breathe>breadth </a> </td> <td><a href=#acknowledgement> acknowledgement </a> </td> </tr> </table>

只需添加table { overflow: hidden; } table { overflow: hidden; }到 CSS

 table, td, th { border: 1px solid; text-align: center; padding: 15px; font-family: 'League Gothic', sans-serif; font-size: 25px; colour: green; overflow: hidden; } th, td { border-style: groove; border-color: #96D4D4; } td:hover { background-color: #5eff67; } table { border-collapse: collapse; background-color: #77fc7e; border-radius: 30px; border-style: hidden; /* hide standard table (collapsed) border */ box-shadow: 0 0 0 1px #666; /* this draws the table border */ } td { border: 1px solid #ccc; transition: background-color 0.5s }
 <table border="1"> <tr> <td><a href=#smile>smile section</a><br></td> <td><a href=#exercise>physical activity</a><br></td> <td><a href=#sleep> sleeping habit </a><br></td> <td><a href=#eating> eating </a><br></td> </tr> <tr> <td><a href=#grateful> greatful </a> </td> <td><a href=#providing> providing </a> </td> <td><a href=#breathe>breadth </a> </td> <td><a href=#acknowledgement> acknowledgement </a> </td> </tr> </table>

暂无
暂无

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

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