Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can I give padding, or margin to a background image

Status
Not open for further replies.

photoxprt1868

Programmer
Jul 22, 2005
76
US
I have a some TDs that have a background arrow.gif applied to them through styles. I have it positioned top, left, but it's too close to the top. How can I lower that a couple of pixels without affecting the whole TD?

Thank you very much.
 
something like this:

Code:
td {
  [gray]/* color, image, repeat, distance from left, distance from top */[/gray]
  background: transparent url(/img/img1.gif) no-repeat .5px .5px;
}

*cLFlaVA
----------------------------
[tt]I already made like infinity of those at scout camp...[/tt]
beware of active imagination: [URL unfurl="true"]http://www.coryarthus.com/[/url]

BillyRayPreachersSonIsTheLeetestHax0rDude
[banghead]
 
this is what I have right now. I see it working in Dreamweaver (design view), but not when I preview it. What am I doing wrong?

Code:
.myAccLinkTDs{
	background-image:url(/fplcommon/wrapper/images/arrowGreenBG.gif);
	background-repeat:no-repeat;
	background-position:.5px 2px;
	padding:2px 0px 2px 20px;
	/*border-bottom: 1px dotted;*/
	border-bottom-color: #C6F0BF;
}
 
I'm not entirely sure what the "." is representing in front of the unit - I didn't think you could have less than one pixel units (0.5 pixels?).

Try removing the .s:

Code:
background-position: 5px 2px;

Hope this helps,
Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
and if you're trying for 1/2 a pixel, you can't. the smallest pixel amount is 1.

*cLFlaVA
----------------------------
[tt]I already made like infinity of those at scout camp...[/tt]
beware of active imagination: [URL unfurl="true"]http://www.coryarthus.com/[/url]

BillyRayPreachersSonIsTheLeetestHax0rDude
[banghead]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top