2

Inline tags are presented as a series of <div>s, with no whitespace in the HTML between them. These elements are styled display:inline, the result of which is an unbreakable string. When you have enough tags this breaks layout. What you want is tags to word-wrap around, but they don't.

The only way I can see to achieve this is by hacking core to insert a space after the field-item items' <div>s (or after the content before the closing </div>.

Is there another way? Perhaps a way for a theme to override the formatter function?

1
  • Are you saying that when you have enough tags, rather than the tags moving to the next line they just all stay on the same line? May 8, 2012 at 15:03

2 Answers 2

3

Try using display: inline-block instead. It gives you the functionality of an inline element, but you can apply margins and padding to it just like a block-level element.

3
  • Ah I see. Does float:left; on those elements help at all?
    – Clive
    May 8, 2012 at 16:56
  • 1
    ooh, you're quick! I deleted that comment while I did further testing! (for other readers, I had commented: Thanks, but this is far from simple. Because you have div.field-label then, div.field-items which contains the set of div.field-items if you set display:inline-block on any of these the label is no longer inline.). Answer seems to be: set inline on the .field-items container and inline-block on the .field-item containers. I suspect float:left will be required by ie, not tested yet. May 8, 2012 at 16:58
  • Ah yes, good old IE. Just hearing those two letters makes me want to tear my hair out! ;)
    – Clive
    May 8, 2012 at 17:03
2

I typically either make them inline-block or make my own theme_field for my theme. I would say I tend to do the latter more. Typically, I just copy the default implementation into my theme, rename, and make minor adjustments. More often than not, though, I am already making formatters for specific fields.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.