Help - Search - Members - Calendar
Full Version: CODE example text styling
HTMLHelp Forums > Administrative > Feedback and Assistance
Christian J
Maybe it's just me, but I think the CODE examples are hard to read:

CODE
window.onload=function()
{
    var a=document.getElementsByTagName('a');
    for(var i=0; i<a.length; i++)
    {
        a[i].style.color='#0f0';
    }
}


due to the font (Verdana? which uses too much letter-spacing) and line-height (too high).

My personal preference is Courier New with 1em line-height. wub.gif
pandy
I suck at font recognition, but that ain't Verdana. Looks fixed width to me. unsure.gif
jimlongo
Yes Courier would be better imo, it's more illustrative of code, and it stands out better from message test. Same for HTML and SQL BBcode.
Christian J
QUOTE
I suck at font recognition, but that ain't Verdana. Looks fixed width to me.


You're right. And I even confirmed that it was monospaced a few days ago. blush.gif

Must be Courier then (i.e. not Courier New, which is much nicer). Anyway, the annoying things are the letter-spacing and line-height. Especially in HTML tags the < and > look stretched-out:

CODE
<table width="717" height="231"
John Pozadzides
I've made a couple of changes. This is the current applicable CSS:
CODE
.codemain,
.sqlmain,
.htmlmain
{
    background: #FAFCFE;
    border: 1px dotted #000;
    color: #465584;
    font-family: Courier, Courier New, Verdana, Arial;
    margin: 0 auto 0 auto;
       line-height: 1em;
    padding: 0px;
    width: 98%;
}


Anything else we want changed?

John
Christian J
QUOTE(John Pozadzides @ Aug 28 2006, 09:33 PM) *

I've made a couple of changes. This is the current applicable CSS:


CODE
font-family: Courier, Courier New, Verdana, Arial;


I'd much prefer "courier new" before "courier" in the list, possibly ending with the generic "monospace":

CODE
font-family: "Courier New", Courier, monospace;


And maybe you could use the same padding as in the QUOTE boxes?
John Pozadzides
Done.
Christian J
Thank you. smile.gif

If someone complains about the line-height being too small, I guess it's OK if you increase just a little (but it's fine with me now, mind you). As long as you don't remove the Courier New font...
Darin McGrew
How about "Lucida Console"?

For that matter, it might make more sense to use <pre class="codemain"> than <div class="codemain">.
Christian J
QUOTE(Darin McGrew @ Aug 29 2006, 01:29 AM) *

How about "Lucida Console"?


First impression is a bit odd, with the uneven letter heights:

look how small lower-case "t" is: <table>, same thing with UPPERCASE text

Which fonts do you use in your text editors?

John Pozadzides
QUOTE(Christian J @ Aug 28 2006, 06:53 PM) *

Which fonts do you use in your text editors?

I try not to use Text editors. smile.gif
But Lucidia Console is the default.
pandy
I use Bitsream Vera Sans Mono, but I've yet to find one I really like.

QUOTE(Darin McGrew @ Aug 29 2006, 01:29 AM) *

For that matter, it might make more sense to use <pre class="codemain"> than <div class="codemain">.


Yeah, it must be PRE so whitespace isn't collapsed. mellow.gif
Or is the DIV styled that way?
Christian J
QUOTE(John Pozadzides @ Aug 29 2006, 02:07 AM) *

I try not to use Text editors. smile.gif


You mean you use WYSIWYG-editors? ohmy.gif
John Pozadzides
QUOTE(Christian J @ Aug 29 2006, 06:34 PM) *

QUOTE(John Pozadzides @ Aug 29 2006, 02:07 AM) *

I try not to use Text editors. smile.gif


You mean you use WYSIWYG-editors? ohmy.gif

Hell no! I actually use Homesite most often, and stay away from notepad when possible. I've got all my little shortcuts memorized in Homesite and I can display the text in any font I please. Not that notepad won't do it also... but let's face it. Notepad just sucks and I equate it with Text editors in general.

John
pandy
Notepad sucks but you would be surprised how much text editors have evolved since the days Notepad was new and hot. tongue.gif

I've only tried the old HomeSite. And TopStyle.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.