How to display image field inline in Drupal
Drupal is one of the greatest CMS right now. It is possible to build a site in minutes and a few days for customization without changing single line of existing codes. That means upgrading is painless. CCK is very powerful for customizing existing content types such as blog to have inline image per node using image field. However, default behavior is to display the image separately. It is not nice so I have to customize myself.
It depends on what the field name is. My field is named icon. So I added below lines to style.css
.
.node .content .field-field-icon img { border: 0; float: left; padding: .5em; } .node .links { clear: both; }
Don't forget to replace .field-field-icon
to the correct field class. clear: both
is necessary for very short content especially in teaser mode.
Tags: drupal, cck, imagefield
- sugree's blog
- 5996 reads
Post new comment