I've added a image field to a content type. All works great, but when I add more than one image, they appear as so:
Image 1
Image 2
Image 3
I'd like for them to be as so:
image 1 Image 2 Image 3
Ie, horizontal rather than vertical.
Is there a simple way to do this? I'm guessing I need to override a theme function or something? but I'm not really clued up on that side of things.
Any suggestions?
Thanks.
| Comment | File | Size | Author |
|---|---|---|---|
| imagefield-scaled.jpg | 8.52 KB | Anonymous (not verified) |
Comments
Comment #1
Boletus commentedI usually look at the source code for the page. The fields you've added have div classes like "field-your-field-name".
I add a css class to the stylesheet like:
div.field-your-field-name {
float: left;
margin-right: 20px;
}
Comment #2
Anonymous (not verified) commentedThanks!
I should of thought of the css, but was thinking of php templates. Got it now. all I need to do now I know how to overide it is work out how to re-arrange it how I want using css, I think I should be able to figure that out with a bit of reading up on css (a fair bit rusty with css).
kelly
Comment #3
Anonymous (not verified) commentedSeems i need the following for it to work, its not quite right, but it just about works how i want it.
First override the imagefield to position it where we want:
div.field-field-image {
position: relative;
padding-right: 65px;
left: 155px;
visibility: show;
align: center;
}
(i didn't want it to the left, wanted it above other items ont he page, but in the centre, hence css above)
Then, to display images inline:
div.field-item {
padding-right: 5px;
display: inline;
border-spacing: 15px 0px;
}
It could probably be done a lot better, and I'm not sure if with more than 3 images it would cause problems.
If anyone has any clearer/better css that'd achieve the above, i'd be glad to see it :)
Kelly
Comment #4
green monkey commentedKelly,
Wow, thanks big time. I have been trying to figure this out all night. Read tons of stuff that was alot harder and most of it over my head.
me likes the css approach
thanks
Comment #5
wallbay1 commentedsubscribing
Comment #6
andrewbenkard commentedTHANKS KELLY
(and my new friend css injector)
Comment #7
sockah commentedA very elegant solution. I thank you. I was originally looking at way more complicated means to achieve the same end.