Jump to content

img padding


kurt.santo

Recommended Posts

Created a class to be applied to two <div> elements. One has text, the other only a background colour with a graphic on top. My CSS is:

.lightGreen	{			background:#d9d9a2 url(background/ranges.gif) repeat;			font-size:10px;			color:#FFF;			margin:0px 0px 10px 0px;			padding:4px 0px 6px 4px;			}			.lightGreen img	{				padding:0px;				margin:0px;				}

For some reason there is padding applied to the images, which increases the height unnecessarily. I have padding and margin value applied to <img> for the container the class is in. Is that the reason? Or what else might go wrong?Kurt

Link to comment
Share on other sites

There isn't any padding or margin on the images in the lightGreen class, so that shouldn't be an issue. It might be that the padding of the lightGreen class is misaligning the image, but there shouldn't be any padding on the image itself, according to that code.

Link to comment
Share on other sites

There isn't any padding or margin on the images in the lightGreen class, so that shouldn't be an issue. It might be that the padding of the lightGreen class is misaligning the image, but there shouldn't be any padding on the image itself, according to that code.
I thought so, but when you clicked in Dreamweaver onto the image itself it always showed the border with some sort of padding, which obviously increased the height unnecessarily. As a solution I put the graphic in the background, but struggle now a bit to find out how to make the whole area of the div clickable (link). Is there any way to do this? Or at least the area where the graphic and the text show? I tried to put the div into <a href>, but this did not work:-(Kurt
Link to comment
Share on other sites

You can put an onclick event on the div. But your problem might also just be Dreamweaver, if you change anything in the layout view Dreamweaver might change your code and do something you didn't want to do.
Code looks fine (Dreamweaver left is alone)... I cannot use just a simple HTML <a href> somehow?Kurt
Link to comment
Share on other sites

Wrapping the div in a href didn't work??<a href="" ><div> </div></a>???
I correct my statement: the mouse pointer is a bit funny when you go over the div (although it will follow the link). IE does not even show the hand, what is a bit confusing... Any ideas why this happens?Kurt
Link to comment
Share on other sites

There is a CSS property called cursor that you can use to say which mouse cursor should be used. The value for the hand cursor is "pointer" I believe.
Cheers, mate. Solves my problem...How do you know all those things? I mean, you are helping me out no only in this section here...Kurt
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...