Support Forums
inline css question - Printable Version

+- Support Forums (https://www.supportforums.net)
+-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87)
+--- Forum: Webmaster Support (https://www.supportforums.net/forumdisplay.php?fid=36)
+---- Forum: Website Development (https://www.supportforums.net/forumdisplay.php?fid=43)
+---- Thread: inline css question (/showthread.php?tid=25684)



inline css question - andrewjs18 - 03-20-2012

been a while since I messed with much html and css....is it possible to style an image using inline css so that it doesn't have any padding and no margins?

for example, how would I use inline css to remove the margins & padding here?:

Code:
<a href="http://test.com" title="test link">Test Link<img src="http://test.com/test.jpg" alt="test logo" /></a>



RE: inline css question - Haxalot - 03-24-2012

I dont quite understand what you want from the code example you gave. There is no padding or margins on the code above, because it is not inside a larger element on the page.

The following properties are what you will be needing if you run into this problem in the future however:
Code:
padding
margin

Both support up to four paremeters, whereby 1,2,3,4 match top, right, bottom, left respectively. Or alternatively you can extend the properties with -[left|right|top|bottom] for specifying only one value to be different. E.g.
Code:
/*1px,2px,3px,4px are top,right,bottom,left repectively*/
padding-top: 1px 2px 3px 4px
padding-bottom
padding-left
padding-right

In order to access these, you must use the style, class or id attribute inside your tag to get the styles to render upon said element.

Side Note: I would advise against using the style attribute because you will not be able to cache your css, meaning slower page load times in the future.