Jump to content

img padding


kurt.santo
 Share

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.
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...