Quick CSS query..
- Started
- Last post
- 5 Responses
- RustyBadge
..I know there are a few CSS masters out there, can anyone explain something for me...
I've been trying to add padding values to images and they are not working. Any ideas what I'm doing wrong? I can give the image a border, or float it right etc, but it doesn't allow me to add padding to it....
For example, I tried it on this page I'm building:
http://www.langaredsgard.com/bil…
Any help much appreciated.
- weestu0
set the padding on the img tag:
img {
padding: 5px;
}or if you need it to be more specific:
.class img{
padding: 5px;
}
- RustyBadge0
Thanks Wee Stu. I tried that. I have a class called .thumbs which I added that padding instruction to... it doesn't seem to apply it...
- Gordy220
Hey... try using margin, not padding.
Padding is for internal sizing, margin's for external; adds space on the outside.
something like:
.img {margin:5px 5px 5px 5px}
The numbers corespond the the sides of the element - top, right, bottom, left.
Should work. Give me a shout back on here if not.
- weestu0
got it. you need to set the images to display inline, so in your thumbs class add:
.thumbs{
display:inline;
margin:5px;
}use margin instead of padding like Gordy said and it should work.
- Gordy220
Gold star weestu.