在这个页面上,标记中的引用是如何<img>
完成的?样式表有[src]
选择器,但我迷路了(或者愚蠢地不知情)。
CSS 如何让 HTML 知道图像在哪里?
<!doctype html>
<title>Slideshow</title>
<link href=s.css rel=stylesheet>
<ul>
<li><img src=1>
<li><img src=2>
<li><img src=3>
<li><img src=4>
</ul>
@-webkit-keyframes f {
0% { opacity:0; }
12% { opacity:1; -webkit-transform:scale(1.03) }
25% { opacity:1; -webkit-transform:scale(1.06) }
37% { opacity:0; -webkit-transform:scale(1.30) }
100% { opacity:0; } }
@-moz-keyframes f {
0% { opacity:0; }
12% { opacity:1; -moz-transform:scale(1.03) }
25% { opacity:1; -moz-transform:scale(1.06) }
37% { opacity:0; -moz-transform:scale(1.30) }
100% { opacity:0; } }
body { background:#f0f0eb }
ul, [src] { position:absolute }
ul { overflow:hidden;
top:50%;
left:50%;
width:650px;
height:300px;
margin:-200px 0 0 -340px;
padding:0;
list-style:none;
border:15px solid #fff;
-webkit-box-shadow:0 1px 2px rgba(0,0,0,.2);
box-shadow:0 1px 2px rgba(0,0,0,.2) }
[src] { opacity:0;
-webkit-animation:f 12s linear infinite; -moz-animation:f 12s linear infinite }
[src="2"] { -webkit-animation-delay:3s; -moz-animation-delay:3s }
[src="3"] { -webkit-animation-delay:6s; -moz-animation-delay:6s }
[src="4"] { -webkit-animation-delay:9s; -moz-animation-delay:9s }