White space around images and objects
以前给图片和文字之间加间隙的方法使用的MARGIN或者PADDING值!今天无意中发现了img标签里面有一个专门的属性hspace&vspace可设置或返回图片(或者OBJECT)的水平间距,可以配合align使用
The vspace and hspace attributes specify the amount of white space to be inserted to the left and right (hspace) and above and below (vspace) an IMG, APPLET, OBJECT. The default value for these attributes is not specified, but is generally a small, non-zero length. Both attributes take values of type length.
这样做更有语意,w3c也是支持的语法格式如下
imageObject.hspace=pixels
function setSpace(){
document.getElementById("el").hspace="50"
document.getElementById("el").vspace="50"
}
