Post Reply 
Scrolling code boxes?
Jun. 15, 2009, 04:35 AM
Post: #9
RE: Scrolling code boxes?
I used my proxy to make some chages to the content of: prxbx.com/forums/cache/themes/theme5/global.css

I tried using some "100%" values to keep the code block within the window size but could not find a decent multi-browser solution for them. I ended up using an explicit width of 800 pixels. I'm not that good at CSS, there may be better solutions.

First, in the main body definition I commented out the line-height: assignment. It was not terminated with a semicolon, and so the margin: setting was not being properly assigned. My change was to put the /* ... */ surrounding it.
Code:
body {
    background: #92ADC0;
    color: #000;
    font-family: Verdana, Arial, Sans-Serif;
    font-size: 11px;
    text-align: center;
/* line-height: 1.4 */
    margin:0px;
    padding:0px;
}

Then I removed the previous overflow: auto from the .codeblock code section. My change was to put the /* ... */ surrounding it.
Code:
.codeblock code {
/* overflow: auto; */
    height: auto;
    /*max-height: 200px;*/
    display: block;
    font-family: Monaco, Consolas, Courier, monospace;
    font-size: 13px;
}

Next I added attributes for white-space: and width: and max-width: and overflow: to the CSS definition for .codeblock section. They're shown here in upper case just for clarity.
Code:
.codeblock {
WHITE-SPACE: nowrap;
WIDTH: 800px;
MAX-WIDTH: 800px;
OVERFLOW: auto;
    background: #fff;
    border: 1px solid #ccc;
    padding: 0px;
}

I tested those in a few Firefox and Opera versions. They did not fully resolve IE-6 (see below), and I have not tested with any other IE version.

For IE 6 browser only the overflow value needed to be changed from auto into scroll. Otherwise the scroll bars that it used would obscure some of the text being shown. That's illustrated in the attached 'IE6_Problem.gif' (using auto) vs. the 'IE6_Scroll_Fix.gif' (using scroll). So for IE 6 only, the style looks like:
Code:
.codeblock {
white-space: nowrap;
width: 800px;
max-width: 800px;
OVERFLOW: scroll;
    background: #fff;
    border: 1px solid #ccc;
    padding: 0px;
}

My suggestion would be for the forum's CSS to exclude consideration of IE-6. Then anyone with that browser could use Proxo to customize the CSS to suit their particular needs.


Attached File(s)
.gif  Code_Firefox.gif (Size: 47.55 KB / Downloads: 859)
.gif  Code_Opera.gif (Size: 50.02 KB / Downloads: 898)
.gif  Code_IE6.gif (Size: 49.61 KB / Downloads: 906)
.gif  Code_IE6_Problem.gif (Size: 8.14 KB / Downloads: 882)
.gif  Code_IE6_Scroll_Fix.gif (Size: 11.42 KB / Downloads: 884)
Add Thank You Quote this message in a reply
Post Reply 


Messages In This Thread
Scrolling code boxes? - JJoe - Jun. 12, 2009, 05:35 PM
RE: Scrolling code boxes? - ProxRocks - Jun. 12, 2009, 11:14 PM
RE: Scrolling code boxes? - JJoe - Jun. 13, 2009, 01:01 AM
RE: Scrolling code boxes? - Kye-U - Jun. 12, 2009, 11:21 PM
RE: Scrolling code boxes? - JJoe - Jun. 13, 2009, 12:39 AM
RE: Scrolling code boxes? - ProxRocks - Jun. 13, 2009, 12:49 AM
RE: Scrolling code boxes? - Kye-U - Jun. 13, 2009, 02:26 AM
RE: Scrolling code boxes? - JJoe - Jun. 13, 2009, 04:50 AM
RE: Scrolling code boxes? - Graycode - Jun. 15, 2009 04:35 AM
RE: Scrolling code boxes? - sidki3003 - Jun. 15, 2009, 01:06 PM
RE: Scrolling code boxes? - Kye-U - Jun. 15, 2009, 02:51 PM
RE: Scrolling code boxes? - ProxRocks - Jun. 15, 2009, 04:21 PM
RE: Scrolling code boxes? - Graycode - Jun. 15, 2009, 05:06 PM
RE: Scrolling code boxes? - JJoe - Jun. 15, 2009, 05:47 PM
RE: Scrolling code boxes? - Kye-U - Jun. 15, 2009, 06:12 PM
RE: Scrolling code boxes? - Graycode - Jun. 15, 2009, 06:55 PM
RE: Scrolling code boxes? - JJoe - Jun. 15, 2009, 09:12 PM
RE: Scrolling code boxes? - Graycode - Jun. 15, 2009, 09:30 PM
RE: Scrolling code boxes? - Kye-U - Jun. 15, 2009, 10:10 PM
RE: Scrolling code boxes? - lnminente - Jun. 15, 2009, 10:21 PM
RE: Scrolling code boxes? - ProxRocks - Jun. 16, 2009, 12:16 AM

Forum Jump: