css圖片覆蓋文字 點擊顯示文字


嘗試了一下css中圖片覆蓋文字,起到隱藏的效果,點擊圖片后文字顯示

 

隨手拖個圖片

.html代碼如下:

 1 <!doctype html>
 2 <html>
 3 <head>
 4 <meta chatset="utf-8">
 5 <title>css</title>
 6 
 7 <style type="個人簡歷/css"></style>
 8 <link rel="stylesheet" type="text/css" href="new1.css" />
 9 
10 </head>
11 <body>
12 
13 <p class="fix_in_lefttop" style="color: #aaa;
14                                  border: 1px black solid;
15                                  text-align: center;
16                                  width: 50px;" >
17     haha
18     haha            
19 </p>
20         
21     <div class="fix_in_lefttop">
22         <img class="heihei" src="圖片2.jpg" alt="圖片2" height="100">
23             
24     </div>
25 
26 
27 </body>
28 </html>

 

.css代碼如下:

 1 .fix_in_lefttop
 2 {
 3     position: fixed;
 4     top: 35px;
 5     left: 25px;
 6     overflow: hidden;
 7 }
 8 
 9 img.heihei:active 
10 {
11     opacity: 0;
12 }

效果如下...

未點擊時:

 

 

點擊時:


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM