日期:2014-05-16  浏览次数:20619 次

<img>遇到问题
初学html一枚!
<body>
<span class=lyrics align="center">
<img src="Sparks fly.jpg" alt="Sparks fly-Taylor Swift" width="500" height="500" border="1" />

Sparks Fly
</span>
Taylor Swift
The way you move is like a full on rainstorm
And I'm a house of cards
Your the kinda reckless that should send me run
But I kinda know that I won't get far
</body>



求问为什么图片不能被文字包围?而且alt没有作用?

------解决方案--------------------

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
#cover{width:100px;height:auto;background-color:#f00;}

img{float:left;display:block;background-color:#ddd;font-size:8px}
</style>
</head>

<body>
<div id="cover">

<img src="Sparks fly.jpg" alt="Sparks fly-Taylor Swift" width="50" height="50" border="1" />

Taylor Swift
The way you move is like a full on rainstorm
And I'm a house of cards
Your the kinda reckless that should send me run
But I kinda know that I won't get far
</div>
</body>
</html>


------解决方案--------------------
而且alt没有作用?
re:

只有图片不显示时,才能看到alt的属性值