APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

Scrollbars for PRE tags

© June 2006 Anthony Lawrence

I recently added scroll bars to the <pre> tags we use here. In some cases you can widen your browser enough to make them go away, though you'd need a pretty wide screen or very small fonts to take them off the first half of that page.

Some folks find these annoying. Let me first tell you WHY I employ them - it's the usual excuse: browsers don't follow standards well, so what looks good with IE may not with Firefox, and is apt to be completely different in Opera (the only one that apparently even cares about standards, by the way) and so on. So if I have a column floated to the right of PRE text, and the text in the PRE is too wide for the space allowed, part of that text will just disappear with some browsers or will overlap the right hand column with others. As "whether it fits" depends on your screen, your browser width, and your choice of font sizes, I have no choice but to use scrollbars.

I used "automatic" bars - they don't appear unless they are needed. That's done by CSS :

width: 50%;
overflow: auto;
padding: 4px;
margin-left: 2em;
font-size: 1.1em;   

So if you really can't stand 'em, you can get rid of them by widening your browser window or reducing your text size. There are other choices, too. You can always choose the "Printer Friendly" link (you'll find it somewhere on every page, often more than once). You can choose the "No Border" or "Plain" style sheet from the main index page. If you are running Firefox, and the Web Developer Plugin, you can even edit CSS tags for any page you are looking at or use your own CSS style sheet (or none at all).

Frankly, it annoys me greatly that I have to be concerned with this stuff. In the "old days", a plain text web site was fine, it was the content that mattered. I didn't use fancy columns and didn't need CSS. It was all vanilla HTML. It wasn't pretty, but the content was what counted.

Well, no more. Content isn't enough today, you have to at least try to "dress up". It was simply a case of adapt to what people expect or die on the backwaters of the Internet. I chose to get a (web) haircut and try to keep the shoes shined most of the time. I still don't wear a tie (on the web or in person), but I do pay some attention to presentation.

And by the way, I really, REALLY appreciate it when y'all point out broken or badly formatted pages. I appreciate it it very much - don't forget to tell me what browser/OS you are seeing the problem with because sometimes I won't see it with my browser. I ALWAYS want to know about problems.

Though (unfortunately) there are things I can't fix. Sometimes, browsers are simply "broken" in that they don't even come close to doing what they are supposed to do. I could look for specific browsers and provide different CSS or even different pages, but that's more work than I want to do. I will TRY to fix anything that's annoying you or at least offer a work-around.

Got something to add? Send me email.

(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> Scrollbars for PRE tags


Inexpensive and informative Apple related e-books:

Digital Sharing Crash Course

El Capitan: A Take Control Crash Course

Take Control of Numbers

Take Control of High Sierra

Take Control of iCloud, Fifth Edition

More Articles by © Anthony Lawrence

Thu Jun 22 17:46:57 2006: 2145   bruceg2004

I personally prefer to read the print page, since it omits all the ads, and looks "old school". MacFixit.com has kept their old school look, and I find it much easier to read. Too many websites out there are too concerned with the fluff. It's still all about the content.

I really dislike ads on any site, but I often click on the ads here, and have even purchased some books on Amazon with links from this site. Which reminds me; when is the next book review? It seems like those have been on hiatus?

- Bruce

Thu Jun 22 17:50:02 2006: 2146   bruceg2004

I forgot to ask this in my last post, but is there any way to read the print page, with comments?

- Bruce

Thu Jun 22 18:04:18 2006: 2147   TonyLawrence

There haven't been a lot of books that have interested me lately, but at least two or three are on their way and I should have them soon.

Ads are a fact of life: I tried running this site on donations but it was never enough money.

I'll add something to PrinterFriendly to bring in the comments.

Thu Jun 22 18:35:48 2006: 2148   TonyLawrence

OK, I added the "new" comments anyway. It's too much trouble right now to add the very old comments, but at least current articles will print these now.

Thu Jun 22 19:03:44 2006: 2149   TonyLawrence

Another point on ads:

When they are relevant (and they often are) I really feel they add (no pun) value to the page. As a publisher, I can't directly click on ads I find interesting, but I can and do right click and extract the real web site quite often because it is something I want to know more about.

Look at this page, for example. Many of the ads are about CSS - that's appropriate and might be of interest if you have more questions as a result of this little piece.

I really think appropriate ads improve a page.

Fri Dec 22 04:00:52 2006: 2769   TonyLawrence

And it turns out that while I was able to fix everything else with Yahoo Grids ( see
(link) ), Microsoft IE6 still screws that up if there are PRE tags in the page..

Fri Dec 22 15:22:33 2006: 2772   BigDumbDinosaur

IE 6 screws up everything, including the systm on which it is installed.

Fri Dec 22 15:45:02 2006: 2774   TonyLawrence

Yes, it does, but it's particularly bad at columnar pages, and PRE tags make it worse. Unfortunately, it will be quite a while before IE7 is common, so I have to live with it for now.

For 2006, IE in general still leads Firefox usage at this site: 724,000 to 666,000.

Next largest is Safari at 93,000, Opera at 47,000 and Mozilla browsers at 40,000. Everything else is under 20,000.

Within IE, 672,00 are IE6 and only 40,000 are IE 7. The rest are IE5 or worse..

Fri Dec 22 20:15:43 2006: 2775   BigDumbDinosaur

For 2006, IE in general still leads Firefox usage at this site: 724,000 to 666,000.

That's not all that much of a spread, considering that IE is loaded by default, whereas the user has to install and set up Firefox.


Printer Friendly Version

Have you tried Searching this site?

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us

Printer Friendly Version

We are stuck with technology when what we really want is just stuff that works. (Douglas Adams)

Linux posts

Troubleshooting posts

This post tagged:


Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode