CSS implementation text translucent display on the image method

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.