Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By bstrange on
I made a custom field for a content type, one that I may use on additional content types.
It is an image field that provides an "Article Image" it's machine name is field_art.
My question is: "Is there a small section of code I can add to my style.css that will make any image of that field type float left and apply the margins I desire?
I tried adding the following to CSS per some other posts I read and none worked :
.field-art .field-item img {
float: left;
margin: 0 10px 10px 5px;
}
.field-art {
float: left;
margin: 0 10px 10px 5px;
}
.art img {
float: left;
margin: 0 10px 10px 5px;
}
Please help, I have googled this and found several pages but none have the same answer and any variation of what I have read has failed to get my images floating.
Comments
Have you checked that the
Have you checked that the class .field-art exists in the HTML source? Usually field names have class like .field-name-field-art. You just need to inspect the source withe Firebug (or similar tools) and check what class is in the source, then use that.
Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors