Two Laptop Bag
The moose likes Ranch Office and the fly likes the Code tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » This Site » Ranch Office
Bookmark "the Code tag" Watch "the Code tag" New topic

the Code tag

Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

Is it just me, or is the code that shows upp when you use the [CODE] tag seem really small and hard to read. Is there a way to make the font larger and bold?

Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
Rob Ross

Joined: Jan 07, 2002
Posts: 2205
No it's not just you.
There was a discussion of this same topic last week...but I think the resolution was "set your fonts bigger in your web browser."

SCJP 1.4
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
I always wanted to say this myself....untill one day I read a note in the SCJP forum that said (re someone else's post):
"When you use [ code ] tags, I can solve your problem in half the time."
and I think it was either you or Rob....
(Not sure.)
So from then on I started editing the posts without the tags and put tags around them.
Actually, even I feel the same. They make it hard to read.
- satya

Take a Minute, Donate an Hour, Change a Life
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
You used to be able to put an HTML font tag inside the code tag to increase the font but that doesn't seem to work anymore. I think it would be worth hacking UBB to increase the default font size for the code tag.

Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Jim Yingst

Joined: Jan 30, 2000
Posts: 18671

"I'm not back." - Bill Harding, Twister
Michael Matola
Ranch Hand

Joined: Mar 25, 2001
Posts: 1793
My opinion is that it's best to leave things the way they are.
Arguments about altering the font size make the assumption that what you see on your screen is the same as what others see on their screens (or is sufficiently representative).
A quick check of the HTML leads me to believe that UBB implements the [ code] tag with the < pre> tag, which is commonly interpreted by browsers to mean "render the contents in a monospace font."
So hacking it wouldn't be just changing a default (because there's none), but choosing a font and/or size. What would you choose?
(I've recently switched to coding in proportional fonts, and I'm loving it.)
Also, the < pre> tag is also what allows the noncollapsing of whitespace (indentation). Do you want to deal with the various HTML hacks for indentation or have the page use style sheets so you can have both indenation and specific font size?
Why bother with all this when people can set their browsers and screen resolutions to view things how they want?
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974

Here is something to compare it to.
The problem is that there is a big discrepancy between the two sizes. If I make text big enough for the pre tag then it will be too big for the regular text. The answer, in my opinion, is to simply hack UBB so it inserts a < font size="+0" > tag inside the < pre > tag.
[ February 03, 2002: Message edited by: Thomas Paul ]
I agree. Here's the link:
subject: the Code tag
It's not a secret anymore!