我嘗試創建一個網站來顯示帶有圖像的每個產品,但我想禁止用戶下載圖像的產品,當用戶右鍵單擊它時,他/她無法下載它或打開圖像要下載新選項卡,我想顯示下圖中出現的?這個框。
1 回答

胡子哥哥
TA貢獻1825條經驗 獲得超6個贊
像這樣覆蓋你的圖像
<!DOCTYPE html>
<html>
<head>
<title>some title</title>
<style>
* {
box-sizing: border-box;
}
.img-container {
width: 300px;
height: 200px;
position: relative;
}
.img-container img, .img-container .img-cover {
width: 100%;
height: 100%;
}
.img-container .img-cover {
position: absolute;
top: 0;
left: 0;
}
</style>
</head>
<body>
<div class="img-container">
<img src="your_image.png">
<div class="img-cover"></div>
</div>
</body>
</html>
- 1 回答
- 0 關注
- 150 瀏覽
添加回答
舉報
0/150
提交
取消