There are several methods. One is: hspace="5" vspace="5" (or whatever number you want to use) The other is <style="padding:5px;"> or you can use the padding attribute within an external stylesheet, which is recommended.
Thanks belgirl. I added to your rep. I understand the hspace tip, but... Does the style="padding:5px;" go inside the <img src=...> tag? Edit: Incidently, I understand the importance of separating style, html, and logic when possible. This is just an exception where I need a quick method to insert into the html.
Glad I could help. Using sample numbers etc., the code would be: <img src="images/yourimage.jpg" width="200" height="200" style="padding:5px;" />
I used "style="padding:10px;"" with superb effect in a WordPress text widget. Glad to have this trick. Thanks.
Inside the widget you don't need to use padding or so, just type it, padding is all the time used in CSS if you know how to use it or edit... I sometimes use padding or margin depends on the situation..
there are varius menthos to keep padding around image. we can place img in div tag and can give padding to div, then w can give the paddng ttribute to image tag itself
Not sure if it will work but try: img { padding-left:; padding-right:; padding-top:; padding-bottom:; }
There are several way to put padding around image : In CSS: img { padding: 20px 20px 20px 20px; } or img { Padding: 20px } In html: <img src=â€xx/x/x.jpg†style=â€padding:20pxâ€> try this it will help you.
Don't use inline styles to put padding on an image, write a class lmao (unless in the very completely rare and unthinkable example where you simply have one image on your entire site but no even in that case separate your styles from your markup). The people who comment on these things make me laugh, if you don't know what you're doing why are you trying to tell other people how to do it?
Yes, exactly. What alex said can't be stressed enough. You do not want to use inline styles except in very rare circumstances, one which I can't think of but I suppose with enough imagination I could come up with such a scenario. You need to keep your structure (HTML) separate from your presentation (CSS). This is just good practice. HTML: <img class='whatever'> Code (markup): External CSS file: .whatever { padding: <top> <right> <bottom> <left>; } Code (markup): If you put in three numbers only, I *believe* it's {top, Left/Right, bottom} - I could be wrong, you can look that up to be sure. Two numbers and it's {top/bottom, left/right}. One number and of course, it's {padding on all four sides}. T-R-B-L is an order worth remembering.
<img src="images/plus_process_controls.png" style="margin-left:420px;" (background:#000; <-- example)/> This is like moving the img to left side . style="margin-left: ... " style="margin-right: ... " style="float:right,left " u can change the background color also ! u could try padding-bot,top,left,right those are also possible ways!
Word of warning, if you are using 'attributes' to apply presentation, INCLUDING the STYLE attribute, you are likely doing things all wrong. The very question that opened this thread is "wrong" any time after 1998.