Css enables corner Image uploading and display of rounded corners

Source: Internet
Author: User

First look at the effect chart

What we want is this effect.

The code is as follows: Copy code

. Box-163css {width: 600px; margin: 20px auto ;}
/* Blogpart2 */
. Blogpart2 {width: 570px; text-align: left; padding-bottom: 15px; overflow: hidden; float: left; margin-bottom: 24px; background: url (.. /images/line02.gif) repeat-x left bottom; border: 1px solid #000; padding: 10px 0 10px 20px; background: # eee ;}
. Kg01 {width: 68px; position: relative; height: 68px; float: left; display: inline ;}
. Kg01. png {position: absolute; z-index: 1000 ;}
. Kg01 img {width: 68px; height: 68px ;}


Html code

The code is as follows: Copy code

<Body>

<Div class = "blogpart2">
<Div class = "maid">

<A href = "/js06.html"> </a>
</Div>
</Div>
<Div class = "blogpart2">
<Div class = "maid">

<A href = "/js06.html"> </a>
</Div>
  
</Div>
<Div class = "blogpart2">
<Div class = "maid">

<A href = "/js06.html"> </a>
</Div>
  
</Div>

</Body>
</Html>

Png. js code

The code is as follows: Copy code

// JavaScript Document

Function correctPNG () // correctly handle PNG transparency in Win IE 5.5 & 6.
{
Var arVersion = navigator. appVersion. split ("MSIE ")
Var version = parseFloat (arVersion [1])
If (version> = 5.5) & (document. body. filters ))
    {
For (var j = 0; j <document. images. length; j ++)
       {
Var img = document. images [j]
Var imgName = img. src. toUpperCase ()
If (imgName. substring (imgName. length-3, imgName. length) = "PNG ")
          {
Var imgID = (img. id )? "Id = '" + img. id + "'":""
Var imgClass = (img. className )? "Class = '" + img. className + "'":""
Var imgTitle = (img. title )? "Title = '" + img. title + "'": "title = '" + img. alt + "'"
Var imgStyle = "display: inline-block;" + img.style.css Text
If (img. align = "left") imgStyle = "float: left;" + imgStyle
If (img. align = "right") imgStyle = "float: right;" + imgStyle
If (img. parentElement. href) imgStyle = "cursor: hand;" + imgStyle
Var strNewHTML = "<span" + imgID + imgClass + imgTitle
+ "Style =" "+" width: "+ img. width +" px; height: "+ img. height +" px; "+ imgStyle + ";"
+ "Filter: progid: DXImageTransform. Microsoft. AlphaImageLoader"
+ "(Src = '" + img. src + "', sizingMethod = 'scale');"> </span>"
Img. outerHTML = strNewHTML
J = J-1
          }
       }
    }    
}
Window. attachEvent ("onload", correctPNG );

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.