John Kenedy
John Kenedy

Reputation: 574

Span inside div does not wrap

I have a div that is a block and have background correctly, inside this div there is a span however the span won't wrap the text inside it but instead pass over the div block.

<div id='code'><span class='kw'>string</span>&nbsp;str&nbsp;=&nbsp;<span class='str'>"SetResult(&#39;LINK1,LINK2&#39;,&nbsp;TagMatch(Return(TagMatch(Download(&#39;http://www.google.com\&#39;),&nbsp;&#39;&amp;lt;a&#39;,&nbsp;&#39;&#39;),&nbsp;&#39;5,6&#39;),&nbsp;&#39;onclick=gbar.logger.il(1,{t:5}); class="</span>gbzt<span class='str'>"&nbsp;id=gb_5&nbsp;href=\"&#39;,&nbsp;&#39;\"&#39;));Download(GetResult(&#39;LINK1&#39;))"</span>;<br/><span class='Var'>Scrapper</span>&nbsp;scr&nbsp;=&nbsp;<span class='kw'>new</span>&nbsp;<span class='Var'>Scrapper</span>();<br/><span class='kw'>string</span>[]&nbsp;results&nbsp;=&nbsp;scr.Multiple(str);</div>

You can view the problem page at here http://innosia.com/Home/Article/WEBSCRAPER Anyone can please help?

Upvotes: 8

Views: 14511

Answers (4)

karthik
karthik

Reputation: 7579

set white-space property to normal.

white-space:normal; 

Upvotes: 17

Riz
Riz

Reputation: 10246

use word-wrap:break-word; in CSS but if you don't like it, use #code{overflow:auto;}.

On you page you have multiple IDs code which is not good. Try to use unique IDs.

Upvotes: 6

Koen.
Koen.

Reputation: 27039

This can probably be achieved with the white-space and overflow CSS properties

Upvotes: 2

w00
w00

Reputation: 26812

Add the style word-wrap:break-word to your span. That should fix your problem.

Upvotes: 2

Related Questions