CSS Strange usage img Add background image matching display--stunning effect

Source: Internet
Author: User

    • The IMG tag itself is the display of the picture, but through the CSS can be set for its background picture, let it and its own picture to display, the final effect will make you marvel. Of course, the discovery comes from a foreigner, so the code is shared with you right away. Before this, I have never thought of this idea, I think this idea can be applied to a considerable number of places.
<!DOCTYPE HTML Public "-//W3C//DTD XHTML 1.0 strict//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd "><HTMLxmlns= "http://www.w3.org/1999/xhtml"Lang= "en"Xml:lang= "en"><Head><title>CSS Fancy usage: Setting a background image for img</title><styletype= "Text/css">Div{background:url (' http://www.codefans.net//jscss/demoimg/201312/blur.jpg ') no-repeat top Left;width:232px;Height:200px; }img{Display:Block;background:url (' http://www.codefans.net//jscss/demoimg/201312/parallax.gif ') No-repeat bottom left;padding:93px 100px 75px 100px;}</style></Head><Body><Div><imgsrc= "Http://www.codefans.net//jscss/demoimg/201312/Anime_runner.gif"alt= "Runner" /></Div></Body></HTML>

----Reprint

CSS Strange usage img Add background image matching display--stunning effect

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.