03 of the text with four styles set in CSS

Source: Internet
Author: User

Translucent text 2, 2, HTML floating on the Image Code
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 strict // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <HTML xmlns = "http://www.w3.org/1999/xhtml" XML: lang = "en" lang = "en"> 

3. CSS Code

/* CSS style sheet for your captions-2a.html] created by [serein_chan] Email: [Serein_Chan@foxmail.com] author blog: [inline * // * body style */body {margin: 0; padding: 0; Background-color: # FFF; Font: 62.5% verdana, sans-serif; color: # 4d4d4d;} p {margin: 0; padding: 0 0 0 1em 0 ;}. captioned_photo {position: relative;/* sets the positioning type of the DIV block so that the sub-element P contained in the DIV block can be located relative to the DIV block rather than the HTML element */width: 240px; display: block; margin: 1em 1em 1em; padding: 1em; Border: 1px solid # CCC; border-top-color: # Eee; border-right-color: # DDD; border-bottom-color: # BBB; Background: URL (images/bg.gif) Bottom left repeat-X;/* Div block gradient background */line-height: 1em; text-align: Left ;}. captioned_photo P {position: absolute;/* relative to the most recently located ancestor element */bottom: 2.25em; left: 1.375em; display: block; width: 240px; /* Set */margin: 0; padding: 0; Background: URL (images/caption-black.png) top left repeat-y to match the image width; /* use a translucent image as the background to achieve transparent cascade effect */font :. 9em verdana, sans-serif; letter-Spacing :. 05em;/* set the space between characters */color: # FFF ;}. captioned_photo P span {display: block; padding: 1em ;}. captioned_photo IMG {margin: 0 0 -. 0625em 0; padding: 0 ;}

reference: The Art & Science of CSS

Related Article

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.