css - How do I limit the minimum and maximum width of an element? -


I have a line of text that I want to attract to the surrounding boundaries. At the moment, the markup looks like this:

  & lt; Div id = "titlebox" & gt; & Lt; Span id = "titleName" class = "truncate" & gt; In fact the long title title is actually & lt; / Span & gt; & Lt; / Div & gt;  

The style looks like this:

  # title box {margin head: 10px; } Name of the title {margin: 5px; Height: 1.6 m; Width: Auto; Max-width: 15.385 PM; Padding: 0.3 9 00; Margin: 0.3 9 00; Line-height: 1.7; Color: RGBA (0,0,0,0.4.4); Background color: RGBA (204,204,204,0.4); Border: 3 px solid RGBA (255, 255, 255,0.14); Font-size: 153.9%; -max-boundary-radius: 5px; -WebKit-boundary-radius: 5px; }. Truncate {white-space: nowrap; Hidden flurry; Text-overflow: oval; -MMS-Text-overflow: oval; -o-text-overflow: oval; -Mo-binding: URL ('../templates/Elipesis.xml # Alpicis'); }  

The effect I want is that I should put the style box in the width of the text, as long as the width does not exceed a certain limit. Then I want to limit the width and then move the trunk line inside.

The problem of using only one div is that the box does not wrap the width of the text. Using the duration helps, but then it does not display as a block. Forcing it to appear as a block, displays a similar problem, such as wrapping it in a plain device. Using a div / span combination does not work either because the span ignores the div's limitations if the text is too long.

Is there a way to limit the width of the text, to reduce it and there is a style box around the text?

According to my comment, display: inline-block should give the desired effect This is however & lt; Will not work in IE6.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -