Hi,
I'm interesting in styling the images I upload with imagefield, in the beginning I looked for a way to add my own css atribute to the image, not finding a way I went the easeir way: just looked using firebug what the class the module give to the image. Found out its: imagefield imagefield-field_fieldname. The problem is css theming just isn't working for some reason.
I place the following code, in many variation and played with it but something seem to work.

.imagefield imagefield-field_mainimage {
margin: auto;
display:block;
padding:10px }

Any idea if I'm missing something?

Thanks in advance

Comments

saltcod’s picture

.imagefield imagefield-field_mainimage {
margin: auto;
display:block;
padding:10px }

Not knowing how much css you know, I'll start from scratch:

Make sure you've got things specific enough:

 .imagefield-field_mainimage {
			border: 5px solid #555;
			}
			

This will put a border around the containing block that the image is in. Whereas, this will put a border around the actual image:

 .imagefield-field_mainimage img {
			border: 5px solid #555;
			}
			

Again, don't mean to talk down to you if you know this already, but would be a good idea to rule out this css error.

Best,

Terry

quicksketch’s picture

Status: Active » Closed (fixed)

Thanks saltcod. CSS questions aren't really in scope for the ImageField queue anyway, I'm closing this issue.

syaman’s picture

Thank you for this post. I have also found it to be incredibly helpful!