D
Disc Magnet
If I wrap a <pre> with style as "overflow: auto" inside a <div> with
style as "word-wrap: break-word;" I get this behavior:
* No scroll bar in Chrome; long lines wrap.
* Long text causes scroll bar to appear in Firefox.
The behavior I need is scroll bar appearing for long lines in all
browsers. Here is the code (also available at http://www.webdevout.net/test?01q
for sometime). Please help.
<html>
<head><title>Console Effect</title>
<style type="text/css">
..wrap {
word-wrap: break-word;
}
pre {
width: 50em;
padding: 2px 5px;
background: #000000;
color: #bbbbbb;
overflow: auto;
}
</style>
<head>
<body>
<p>
Foo
</p>
<div class="wrap">
<pre>
123456789 123456789 123456789 123456789 123456789 123456789 123456789
123456789 1234567890
int main()
{
printf("hello, world\n");
}
</pre>
<p>
Bar
</p>
</div>
</body>
style as "word-wrap: break-word;" I get this behavior:
* No scroll bar in Chrome; long lines wrap.
* Long text causes scroll bar to appear in Firefox.
The behavior I need is scroll bar appearing for long lines in all
browsers. Here is the code (also available at http://www.webdevout.net/test?01q
for sometime). Please help.
<html>
<head><title>Console Effect</title>
<style type="text/css">
..wrap {
word-wrap: break-word;
}
pre {
width: 50em;
padding: 2px 5px;
background: #000000;
color: #bbbbbb;
overflow: auto;
}
</style>
<head>
<body>
<p>
Foo
</p>
<div class="wrap">
<pre>
123456789 123456789 123456789 123456789 123456789 123456789 123456789
123456789 1234567890
int main()
{
printf("hello, world\n");
}
</pre>
<p>
Bar
</p>
</div>
</body>