Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
inline css question
#1
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>
Reply
#2
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Free Worker HTML, CSS, Javascript ImFocuzz 2 1,281 04-05-2014, 10:01 PM
Last Post: VHPanda
  Forum CSS code problem. inferno.lion 0 818 06-10-2013, 02:48 AM
Last Post: inferno.lion
  MyBB CSS Postbit Buttons Peter L 1 1,439 07-14-2012, 05:52 PM
Last Post: 'Snorlax
  Need a CSS Teacher! ImFocuzz 2 1,084 03-08-2012, 06:01 PM
Last Post: BreShiE
  Problem with CSS navigation Fragma 3 1,189 02-02-2012, 02:33 PM
Last Post: Fragma

Forum Jump:


Users browsing this thread: 1 Guest(s)