简体   繁体   中英

span inside div tag produces the multi text instead of inline text

i want to display the text in inline (ie in single line) please refer below code.

<DIV id=container_vml_TrackToolTip style="POSITION: absolute; LEFT: 85px; TOP: 58px">
    <SPAN id=container_vml_ToolTipText style="FONT-SIZE: 12px; FONT-FAMILY: Segoe UI; POSITION: absolute; COLOR: yellow; FONT-STYLE: normal; LEFT: 414px; TOP: 126px; VISIBILITY: visible">2009  32</SPAN>
</DIV>

output produce the following result in IE browser.

在此处输入图片说明

i want to display the text inline instead of multi line in a particular position. how can i do this when placing span inside div tag ?

Thanks, Siva

试试white-space:nowrap

<DIV id=container_vml_TrackToolTip style="POSITION: absolute;LEFT: 85px; TOP: 58px"><SPAN id=container_vml_ToolTipText style="white-space:nowrap; FONT-SIZE: 12px; FONT-FAMILY: Segoe UI; POSITION: absolute; COLOR: yellow; FONT-STYLE: normal; LEFT: 414px; TOP: 126px; VISIBILITY: visible">2009  32</SPAN></DIV>    

To get the text to display inline you'll want to use a width: 100px in your span. For an example please take a look at this version of the code.

<span style="width: 100px; line-height: 20px .....">2009 32</span>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM