Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

inconsistent formatting of CODE blocks

 
Brian Cole
Author
Ranch Hand
Posts: 908
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've noticed that the formatting of CODE blocks varies a lot between browsers. Using IE at work it's in a pretty small font--almost too small. Using Opera on X.5 the font size is almost too large. I would expect some browser differences, though, and that is not in itself the topic of this post.

But I've also noticed that sometimes CODE blocks will have different formatting even within the same page. For example, when I view this page with Firefox 3.0β1 the CODE blocks in the original post use a small font while the CODE blocks in the first reply use a bigger font. (Actually, I have the same page open in two separate windows of that browser. One is as I describe, and in the other all CODE blocks use the smaller font. Go figure.)

I'm finally posting today, but I've noticed this for a couple of years now. Back then the smaller font was almost unreadable (this was mostly with IE on win2k), but on Firefox 3.0β1 the smaller font is nicely sized.

Anyway, any idea why this is happening?

----

Also while I'm here, allow me to point out that if you click on Today's Active Topics from the saloon's root page that it shows the first sentence or two of each post, which is nice.

But if you click on Today's Topics from the My Posts page you don't. Also, clicking on Yesterdays Topics doesn't seem to actually show yesterday's topics.
[ December 15, 2007: Message edited by: Brian Cole ]
 
fred rosenberger
lowercase baba
Bartender
Posts: 12196
35
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i don't think that's exactly a fair comparison in the code blocks. in the second post, the code block in inside a quote block. i'm not surprised they're rendered differently.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Discussion on font size here in Firefox: http://www.coderanch.com/t/3064/Ranch-Office/why-do-code-tags-miniaturize and how to increase the text size for the code tags.

Discussion on better copy and paste:
http://www.coderanch.com/t/3307/Ranch-Office/Losing-format-copying-Code-Tags

Eric
 
Marilyn de Queiroz
Sheriff
Posts: 9067
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Brian Cole:
I'm finally posting today, but I've noticed this for a couple of years now. Back then the smaller font was almost unreadable (this was mostly with IE on win2k)

Anyway, any idea why this is happening?

And here is a discussion of one attempt to change the code size. This seemed to have greater effect in IE than any other browser for some unknown reason.
 
Brian Cole
Author
Ranch Hand
Posts: 908
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Fred Rosenberger:
i don't think that's exactly a fair comparison in the code blocks. in the second post, the code block in inside a quote block. i'm not surprised they're rendered differently.


That's a good point. But I have indeed seen non-quoted CODE blocks of different sizes on the same page. If I see it again I'll post here.
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think most likely you've seen that some code blocks come out in monospace font and some not. I'm aware of the problem. The code which generates that HTML has some problems, and the HTML it generates isn't strictly compliant, and can be rendered differently across different browsers. As I recall, there's a tendency to try to apply fonts across multiple block-level elements, which means some browsers assume implicit close-font tags at the end of a blcok, and some don't. Unfortunately, the code which governs this particular part of the HTML generation is among the most poorly-factored painful-to-read stuff in the codebase, and gives me a headache when I deal with it. We've made various alterations and (I believe) improvements over the years, but haven't been able to get all problems to go away, sorry.

I know Opera, Firefox and Safari make it easy for a user to increase font size on the fly, using shift-plus, ctrl-plus, or cmd-plus, respectively (replace plus with minus to decrease size instead). Dunno if IE has something similar, though I hope so. I use these often on web sites I visit, not just here. Hope that helps.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Brian Cole:
Also while I'm here, allow me to point out that if you click on Today's Active Topics from the saloon's root page that it shows the first sentence or two of each post, which is nice.

But if you click on Today's Topics from the My Posts page you don't.

Yes, the two pages are generated by different pieces of software, in a way that makes it tricky to show the actual text of the post on the second page you mention. That may change in the future, but probably not real soon.

Also, clicking on Yesterdays Topics doesn't seem to actually show yesterday's topics.

Are you saying this because some of the dates show "Today" instead of "Yesterday"? That's because some of the threads that were active yesterday have also been active today. The page doesn't just show threads started yesterday, it shows all threads that were posted to yesterday.
[ December 17, 2007: Message edited by: Ulf Dittmer ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic