Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Span inside div does not wrap

Tags:

html

css

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?

like image 852
John Kenedy Avatar asked Oct 24 '12 09:10

John Kenedy


4 Answers

set white-space property to normal.

white-space:normal; 
like image 121
karthik Avatar answered Sep 28 '22 04:09

karthik


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.

like image 29
Riz Avatar answered Sep 28 '22 06:09

Riz


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

like image 26
w00 Avatar answered Sep 28 '22 04:09

w00


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

like image 38
Koen. Avatar answered Sep 28 '22 04:09

Koen.