Hi,

the default image formating is such:

img {
	padding: 8px;
	border:none;
}

Now when my image is in this span I want it not to have padding.

<span class="article_img">
<input type="radio" name="image" value="http://xx.98.27.116/~ylakiai/uploads/naujienos/naujiena16.jpg">
<img class="no_padding" src="http://xx.98.27.116/~ylakiai/uploads/naujienos/naujiena16.jpg">
<a class="trinti_img" href="" id="naujiena16.jpg">
<img src="http://79.98.27.116/~ylakiai/images/admin/delete.png"></a>
</span>

And I made code in css for no padding:

.no_padding
{
	padding: none;
}

And there still is that padding. I don't know what is wrong there. Can you help me?

Recommended Answers

All 3 Replies

Is...

.no_padding
{
	padding: none;
}

put after...

img {
	padding: 8px;
	border:none;
}

I believe that the image will look at the last styles if there are multiple that apply to it. (don't quote me on that).

Apart from that. I would make a class for each maybe?

Cheers

Danny

.no_padding
{
	padding: none;
}

Yeah, and it actually is the last in css file.

Apart from that. I would make a class for each maybe?

Didn't understand, can you tell more?

Have the solution - I had to write padding:0 instead of padding:none

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.