Home > Web Front-end > CSS Tutorial > Why Does Box Shadow on Table Rows Behave Differently in Different Browsers?

Why Does Box Shadow on Table Rows Behave Differently in Different Browsers?

Barbara Streisand
Release: 2024-10-29 04:00:29
Original
838 people have browsed it

Why Does Box Shadow on Table Rows Behave Differently in Different Browsers?

Inconsistent Box Shadow Appearance on Table Rows Across Browsers

CSS box-shadow applied to table rows () can exhibit inconsistent behavior across various browsers. Despite identical CSS, some browsers may display the shadow as intended, while others may not.

To resolve this issue, it is recommended to utilize the transform property in conjunction with the box-shadow attribute. Adding scale(1,1) to the transform property forces the browser to re-render the element, ensuring that the box-shadow effect is applied uniformly.

Here is the updated CSS code:

tr:hover {
  transform: scale(1,1);
  -webkit-transform: scale(1,1);
  -moz-transform: scale(1,1);
  box-shadow: 0px 0px 5px rgba(0,0,0,0.3);
  -webkit-box-shadow: 0px 0px 5px rgba(0,0,0,0.3);
  -moz-box-shadow: 0px 0px 5px rgba(0,0,0,0.3);
}
Copy after login

By adding this code snippet, the box shadow will now appear consistently across supported browsers.

The above is the detailed content of Why Does Box Shadow on Table Rows Behave Differently in Different Browsers?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template