更新时间:2023-12-04 21:37:16
您无法检测到CSS溢出.但是使用JavaScript就是这样:
You can't detect an overflow with CSS. But using JavaScript it's simply this:
JavaScript
var e = document.getElementById('email');
if (e.scrollWidth > e.clientWidth) {
alert("Overflow");
}
演示