Jump to content
calvin kan

hspace: transform to css

Recommended Posts

hello all :) i m not new to w3schools but i m new to this forumas the attribute hspace of img tag is deprecated, styles is suggested to use instead.http://www.w3schools.com/tags/tag_img.aspi tried the following values in my style sheet for img but none of them can act like the effect of hspace:margin; word-spacing; white-space; padding; and border-spacing; pls advise which value(s) the official counterpart of hspace in css isthanks a lot

Share this post


Link to post
Share on other sites

I think it is margin. Something like this:

img {   margin: 0 5px;}

Which adds 5 empty pixels to each side of the image.Padding normally could be used also, which enlarges the width of the image in the browser, whithout actually enlarging the image's content (so the only difference is that you have a wider space to click if your image is a link, same for right clicking to see the image properties).

Share this post


Link to post
Share on other sites

thanks F-Manyou set a good base for my further questionmy problem is, even i set the img like this:

img {   margin: 0 0px;}

there is still a little space between (two) imgspls advisethanks

Share this post


Link to post
Share on other sites

Maybe because you put a space between them? Remember img is inline, so it is considered like text. Images usually have no margin by defaut so <img/><img/> should look like what you want.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...