Use css to implement an image rounded border method compatible with IE6

Source: Internet
Author: User

<Style>
# Demo h2, # demo h3 {font-size: 1em; font-weight: normal; color: # a40000; margin: 1em auto; position: relative}
# Demo h3 {color: #888; font-weight: bold}
# Demo. box {width: 600px; margin: 2em auto}
# Demo. box li {display: inline; margin: 1em; float: left}
# Demo. box li img {width: 60px; height: 60px; border: 0 ;}
# Demo. box li. I _roundimg {background: url (/demo/images/100508.png) no-repeat; cursor: pointer; width: 60px; height: 60px; position: absolute ;}
/* Use the following code if only one png background is used
. Box li. I _roundimg {background: url (/demo/images/100508.png) no-repeat; _ background: none; filter: progid: dximagetransform. microsoft. alphaimageloader (src = '/demo/images/100508.png', sizingmethod = 'scale'); cursor: pointer; width: 60px; height: 60px; position: absolute ;}
*/
</Style>

<Div id = "demo">
<H2> It is compatible with ie6's image rounded border @ mr. think. It supports ie6, which can be hated and cursed by ten million people ~ </H2>
<Ol class = "box">
<Li> <a target = "_ blank" href = "/"> <span class = "I _roundimg"> </span> </a> </li>
<Li> <a target = "_ blank" href = "/"> <span class = "I _roundimg"> </span> </a> </li>
<Li> <a target = "_ blank" href = "/"> <span class = "I _roundimg"> </span> </a> </li>
<Li> <a target = "_ blank" href = "/"> <span class = "I _roundimg"> </span> </a> </li>
<Li> <a target = "_ blank" href = "/"> <span class = "I _roundimg"> </span> </a> </li>
</Ol>
</Div>

<! -- [If ie 6]>
<Script>
Eval (function (p, a, c, k, e, r) {e = function (c) {return (c <? '': E (parseint (c/a) + (c = c % a)> 35? String. fromcharcode (c + 29): c. tostring (36)}; if (! ''. Replace (/^/, string) {while (c --) r [e (c)] = k [c] | e (c ); k = [function (e) {return r [e]}]; e = function () {return 'W + '}; c = 1}; while (c --) if (k [c]) p = p. replace (new regexp (''+ e (c) +'', 'g'), k [c]); return p} ('2 e = {j: 'E', z: {}, 1e: 7 () {4 (x.1l &&! X.1l [6.j]) {x.1l. 23 (6.j, '24: 25-26-27:3 ')} 4 (1f. 11) {1f. 11 ('28', 7 () {e = 29}) },1g: 7 () {2 a = x.1m ('8'); x.1h. 1b. 1n (a, x.1h. 1b. 1b); 2 B = a.1o; B .1c (6.j+ '\: *', '{12: 2a (# 1i # 2b)}'); B .1c (6.j+ '\: y', 'Q: 1 p; '); B .1c ('1j. '+ 6.j+ '1k', '12: y; 1q: y; q: 1 p; z-2c:-1; 1d:-1r; 1l: 1 m ;'); 6.1o = B}, 1n: 7 () {2 a = 13.2d; 4 (13.1e.k ('2e ')! =-1 | 13.1e.k ('1q ')! =-1) {e.1f (a)} 4 (13.1e = '8. 1s ') {2 B = (a. f.1s = 'y ')? 'Y': '2f '; g (2 v m a.3) {a.3 [v]. 9.8.1s = B} 4 (13.1e.k ('14 ')! =-1) {e.1t (a) }}, 1 t: 7 (a) {4 (a. f.14.k ('2G ')! =-1) {2 B =. f.14; B = 1u (B .2h (B .1v ('=') + 1, B .1v ('), 10)/2i; a.3.n. 9.8.14 =. f.14; a.3.c. I .2j = B }}, 15: 7 (a) {2 k (7 () {e.1f (a)}, 1)}, 2l: 7 () {2 B = a.1o (','); g (2 I = 0; I <B .2m; I ++) {6.1o.1c (B [I], '12: 2n (e.1p (6) ') }}, 1f: 7 (a) {. s.1q = ''; 6.1r (a); 6.16 (a); 6.1 t (a); 4 (. o) {6.1 s (a) },1 t: 7 (B) {2 c = 6; 2 d = {2o: '16', 2 p: '16'}; 4 (B .17 = 'a') {2 e = {2q: '15', 2r: '15', 2 s: '15 ', 2 t: '15'}; g (2 a m e) {d [a] = e [a]} g (2 h m d) {B .11 ('1w' + h, 7 () {c [d [h] (B )}) } B .11 ('2u ', 6.1n)}, 1x: 7 (a) {a.8.2v = 1; 4 (. f. q = '2w') {a.8.q = '2x '}}, 1 s: 7 (a) {2 B = {'2y': p, '2z': p, '2a ': p}; g (2 s m B) {a.3.n. 9.8 [s] =. f [s] }}, 1r: 7 (a) {4 (! A. f) {1g} u {2 B =. f} g (2 v m a.3) {a.3 [v]. 9.8.1u = B .1u}. s.18 = '';. s.19 = ''; 2 c = (B .18 = '1v'); 2 d = p; 4 (B .19! = 'Y' | a. o) {4 (! A. o) {. d = B .19;. d =. d.2b (5,. d.1v ('")')-5)} u {. d = a.1h} 2 e = 6; 4 (! E. z [. d]) {2 f = x.1m ('1j'); e. z [. d] = f; f.2c = e. j + '1k'; f. s.1q = '12: y; q: 1 p; 1y:-1r; 1d:-1r; 1q: y; '; f.11 ('2D', 7 () {6.1i = 6.2e; 6.1j = 6.2f; e.16 (a)}); f.1h =. d; f.1w ('1i'); f.1w ('1j'); x.1x. 1n (f, x.1x. 1b)} a.3.c. I .1h =. d; d = v} a.3.c. I .1w =! D; a.3.c. i. n = 'y'; a.3.n. 9.8.18 = B .18;. s.19 = 'y';. s.18 = '1v'}, 16: 7 (e) {2 f = e. f; 2g = {'W': e.2g + 1, 'H': e.2h + 1, 'w': 6.z[ e. d]. 1i, 'H': 6.z[ e. d]. 1j, 'L': e.2i, 'T': e.2j, '1k': e.2k, '1z': e.2l}; 2 I = (g. l + g.1k = 1 )? 1:0; 2 j = 7 (a, l, t, w, h, o) {a.2m = w + ',' + h; a.2n = o + ',' + o; a.2o = '2 P, 1y' + w + ', 1y' + w +', '+ h + '2q,' + h + '2r '; a.8.1i = w + 'u'; a.8.1j = h + 'u'; a.8.1y = l + 'u'; a.8.1d = t + 'U'}; j (e.3.n. 9, (g. l + (e. o? 0: g.1k), (g. t + (e. o? 0: g.1z), (g. w-1), (g. h-1), 0); j (e.3.c. 9, (g. l + g.1k), (g. t + g.1z), (g. w), (g. h), 1); 2 k = {'X': 0, 'y': 0}; 2 m = 7 (a, B) {2 c = p; 2 s (B) {1a '1y': 1a '1D ': k [a] = 0; 1a; 1a '2t': k [a] =. 5; 1a; 1a '2u ': 1a '2v': k [a] = 1; 1a; 1i: 4 (B. k ('% ')! =-1) {k [a] = 1u (B )*. 2 w} u {c = v} 2 d = (a = 'x'); k [a] = 2x. 2y (c? (G [d? 'W': 'h'] * k [a])-(g [d? 'W': 'h'] * k [a]): 1u (B); 4 (k [a] = 0) {k [a] ++ }}; g (2 B m k) {m (B, f ['2z' + B])} e.3.c. i. q = (k. x/g. w) + ',' + (k. y/g. h); 2 n = f.30; 2 p = {'T': 1, 'r': g. w + I, 'B': g. h, 'L': 1 + I}; 2 q = {'X': {'1b ': 'L', '1c': 'R', 'D ': 'W'}, 'y': {'1b ': 't', '1c': 'B', 'D': 'h'}; 4 (n! = '1D ') {2 c = {'T' :( k. y), 'R' :( k. x + g. w), 'B' :( k. y + g. h), 'L' :( k. x)}; 4 (n. k ('1D -')! =-1) {2 v = n.1o ('1D-') [1]. 31 (); c [q [v]. 1b] = 1; c [q [v]. 1c] = g [q [v]. d]} 4 (c. b> g. h) {c. B = g. h} e.3.c. 9.8.1z = '20 ('+ c. t + 'U' + (c. r + I) + 'U' + c. B + 'U' + (c. l + I) + 'U) '} u {e.3.c. 9.8.1z = '20 ('+ p. t + 'U' + p. r + 'U' + p. B + 'U' + p. l + 'U) '}}, 1 p: 7 (a) {a.8.12 = 'y '; 4 (a.17 = '32' | a.17 = '33' | a.17 = '34') {1g}. o = v; 4 (a.17 = '35') {4 (a.1h. 21 (). k (/. 22 $ /)! =-1) {. o = p; a.8.1l = '1m '} u {1g} u 4 (. f.19.21 (). k ('. 22 ') =-1) {1g} 2 B = e; a.3 = {n :{}, c :{}}; 2 c = {9 :{}, i: {}}; g (2 r m a.3) {g (2 e m c) {2 d = B. j + ':' + e; a.3 [r] [e] = x.1m (d)} a.3 [r]. 9.36 = v; a.3 [r]. 9.37 (a.3 [r]. i); a.38.1n (a.3 [r]. 9, a)} a.3.c. 9.39 = 'y'; a.3.c. I .3a = '3B '; a.3.n. I .1w = v; B .1t (a); B .1x (a); B .1x (a.3c); B .1f (a) }}; 3d {x.3e ("3f", v, p )} 3g (r) {}e.1e (); e.1g (); ', 62,203, '| var | vml | if | this | function | style | shape | px | | document | none | image | vmlbg | evpng | currentstyle | for | fill | ns | search | in | color | isimg | true | position | runtimestyle | | else | false | imgsize | attachevent | behavior | event | filter | handleps tutorial eudohover | vmloffsets | nodename | backgroundcolor | case | firstchild | addrule | top | propertyname | applyvml | return | src | width | height | blw | namespaces | createelement | bytes | stylesheet | absolute | border | pixel PX | display | vmlopacity | parseint | lastindexof | on | givelayout | left | btw | break | b1 | b2 | repeat | createvmlnamespace | window | createvmlstylesheet | documentelement | default | img | _ sizefinder | visibility | hidden | readpropertychange | split fix| PNG | csstext | vmlfill copyimageborders | attachhandlers | zindex | transparent | removeattribute | body | 0l | clip | rect | tolowercase | png | add | urn | schemas | microsoft | com | onbeforeunload | null | url | vml | index | srcelement | background | block | lpha | substring | 100 | opacity | settimeout | fix | length | expression | resize | move | mouseleave | mouseenter | focus | blur | onpropertychange | zoom | static | relative | borderstyle | borderwidth | bordercolor | substr | classname | onload | offsetwidth | offsetheight | clientwidth | clientheight | offsetleft | offsettop | clientleft | clienttop | percent | path | m0 | l0 | xe | switch | center | right | bottom | 01 | math | ceil | backgroundposition | backgroundrepeat | touppercase | body | td | tr | img | stroked | appendchild | parentnode | fillcolor | type | tile | offsetparent | try | execcommand | backgroundimagecache | catch '. split ('|'), 0 ,{}))
Evpng. fix ('div, span '); // evpng. fix ('@ mr. think prompts you: Set the tag containing the transparent png image here. Multiple tags are separated by commas.
</Script>
<! [Endif] -->

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.