CSS implement text translucent display on the image method
In CSS the text is translucent we will need to use the filter effect is the CSS in the Filter:alpha to achieve, the following two text display in the picture and translucent example.
CSS lets a line of text appear at the bottom of the picture, to describe the contents of the picture, as a picture title, title text and background can be set to translucent, the mouse through the picture border color change.
Code Preview
The code is as follows |
Copy Code |
<HEAD> <meta http-equiv= "Content-type" content= "text/html; charset=gb2312"/> <title> text display on the image </title> <style type= "Text/css"; *{border:none;text-decoration:none} . wrap{margin:8px;position:relative} . Photo a{position:absolute;display:block;border:1px solid #555555;} . Photo a:hover{border:1px solid #FFFFFF;} . Photo span{width:633px;background: #000;d isplay:block;position:absolute;bottom:0;left:0;color: #fff; Filter: Alpha (OPACITY=50);-moz-opacity:0.6;opacity:0.6;font:bold 12px/30px Verdana, Arial; Text-align:center;cursor:hand;} . Photo a:hover Span{text-decoration:underline} </style> <body> <div class= "Wrap", <div class= "photo" ><a href= "#"; <span> title stacked on the picture, title text and background translucent. The mouse passes through the border for color change. </span></a></div> </div> </body> |
This feature can be derived from a lot of other versions, such as mouse slide when the introduction of text is displayed. This is still very common. Look at the effect below.
Code Preview
The code is as follows |
Copy Code |
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/> <title> text displayed on the picture </title> <style type= "Text/css" > *{border:none;text-decoration:none} . wrap{margin:8px;position:relative} . Photo a{position:absolute;display:block;border:1px solid #555555;} . Photo a:hover{border:1px solid #FFFFFF;} . Photo Span{width:633px;background: #000;d isplay:block;position:absolute;bottom:0;left:0;color: #fff; filter:alpha (opacity=50);-moz-opacity:0.6;opacity:0.6;font:bold 12px/30px Verdana, Arial; Text-align:center;cursor:hand;display:none;} . Photo A:hover Span{text-decoration:underline;display:block;} </style> <body> <div class= "Wrap" > <div class= "Photo" ><a href= "#" > <span> title stacked on the picture, title text and background translucent but not displayed. The mouse passes through the border to color and displays the caption. </span></a></div> </div> </body> |
You can set the effect according to your own needs.
CSS implementation text translucent display on the image method