问题描述
谁能告诉我下面的代码是什么问题? 代码非常简单,但是如您在屏幕截图中所见,该图像将不会显示... 如果链接断开(虽然没有断开),则什么也没有,甚至没有边框。 那么在这种情况下,为什么图像enter image description here代码是“透明的”?
<!DOCTYPE html>
<html>
<head>
<meta= charset="utf-8">
<title>Display Image</title>
</head>
<body>
<h1>
<p>
Image:
<img= scr="http://lorempixel.com/output/nature-q-c-640-480-1.jpg" width="640" height="480">
</p>
</h1>
</body>
</html>
解决方法
<img= scr="http://lorempixel.com/output/nature-q-c-640-480-1.jpg" width="640" height="480">
=
之后的 img
导致错误。另外,不是scr
,而是src
。所以你想成为
<img src="http://lorempixel.com/output/nature-q-c-640-480-1.jpg" width="640" height="480">