使用 CSS 懸停在元素上時顯示溢位內容
為了在元素上懸停時顯示溢位內容,你可以嘗試執行以下程式碼
範例
<!DOCTYPE html>
<html>
<head>
<style>
div.demo {
white-space: nowrap;
width: 180px;
overflow: hidden;
border: 2px solid blue;
}
div.demo:hover {
text-overflow: inherit;
overflow: visible;
}
</style>
</head>
<body>
<p>Hover to see the complete text below:</p>
<br>
<div class = "demo" style = "text-overflow:clip;">Demo Text that will hide in this box.</div>
</body>
</html>
廣告
資料結構
網路
關係資料庫管理系統
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP