当前位置: 首页 > 网络学院 > 网页制作基础教程 > WEB设计综合 > 图像详述
Adding Images
添加图像
Placing images on your site is very easy. Use the following code:
在站点中添加图像是很简单的事情,你可以使用下面的代码:
<img src="image.jpg" width="width of image goes here" height="height of image goes here" alt="describe your image here"> |
The width and height isn't needed, but it helps the image load faster and can be used to change the size of the image. Also, alt isn't required. This is used in place of the image if it can not be found on the server.
“width[宽度]”和“height[高度]”并不是一定要书写的,但是,它有助于更快地加载图像,并用作改变图像的尺寸。同样的,“alt”指令也并不是必需的,它的作用是,如果浏览器不能加载服务器端的图像,那么,它将显示“alt”中的文本内容。
Image Aligning
图像排列
In order to have text or other objects wrap around an image, you need to use the align tag. It's inserted just like this:
为了能够实现文本在图像旁边的环绕效果,你就需要使用“align[排列]”标签。你可以插入下面这段代码:
<img src="screen.jpg" align="left or right goes here" width="width of image goes here" height="height of image goes here" alt="describe your image here"> |
ex. (不包括)
<img src="images/screen.jpg align="right" width="76" height="110" alt="Screen"> |
Adding space around an image
在图像周围添加空白空间
To add an invisible border to an image use:
为图像添加一个不可见的边框:
hspace="x" (add space to the left and right sides of the image)
hspace="x" (在图像的左右两边添加空白空间)
vspace="x" (add space to the top and bottom of the image)
vspace="x" (在图像的上下两边添加空白空间)
Adding space around an image
在图像周围添加空白空间
To add an image as the background of your page, use the following to the body command:
你可以通过下面这段代码,为页面添加一张图像背景,记住,将它放置在body命令中:
<body background="image url"> |