I have a element (e.g. a label) with a fixed width and I want that only the text to be dotted-underlined. If a do the "trick" with border-bottom the whole box will be underlined
I think this explains my problem
I have a element (e.g. a label) with a fixed width and I want that only the text to be dotted-underlined. If a do the "trick" with border-bottom the whole box will be underlined
I think this explains my problem
On
You should wrap it into a span and add that border-bottom style to that span: http://jsfiddle.net/mrg9a/2/
On
You could wrap the text in <span> tags and then apply the style to the spans.
See the second element in this jsFiddle example.
Since
labelelements are inline by default, the problem is caused by making them inline blocks. This in turn is presumably an attempt to avoid using the most natural and most effective way of structuring a form, namely an HTML table. Just switch totablemarkup and uselabelinsidetdwith no fancy settings, and thelabelelements will take the border you set on them, in their natural width.