...

View Full Version : How to deside font type, size and color in a "inputbox"?



hvadseth79
12-28-2003, 08:05 AM
I have a javascript that produce some text in a input box. But the text has default fonttype, size and color. How do I deside my own size and type?...

Philip M
12-28-2003, 10:37 AM
Here's an example:-

<p align="center"><center><font face="Arial" size="3" color="#FF0000"><em><b>Additional Comments or Remarks</b></em><br><textarea name = "Remarks" cols = "54" rows = "2" wrap="virtual" style = "background:#FFFFFF; font-family: 'Arial' font-size:'11pt'; font-weight:'700'; " onfocus = "this.style.background = '#99FF99'" onblur = "this.style.background = '#FFFFFF'"></textarea></font></center></p>

Paul Jr
12-28-2003, 06:40 PM
Yeah... depreciated tags, JS, quoted styles, other stuff...

Dennis
12-28-2003, 07:22 PM
is something like this deprecated?


object.style.backgroundColor='#ffffcc';
object.style.fontSize='1em';
object.style.fontFamily='something'


!?!

Philip M
12-29-2003, 07:55 AM
Originally posted by Paul Jr
Yeah... deprec(i)ated tags, JS, quoted styles, other stuff...

Ah, yes, but it works!

"Deprecated" tags etc. will be around for a long, long time yet.
There are far too many web pages already in existence.
But suggestions for changing it into css will be very welcome.

Willy Duitt
12-29-2003, 01:44 PM
Originally posted by Philip M
Ah, yes, but it works!

"Deprecated" tags etc. will be around for a long, long time yet.
There are far too many web pages already in existence.
But suggestions for changing it into css will be very welcome.

Try something like this:

<style type="text/css">
textarea{
background-image:url(blue_saturn.jpg);
background:#000000;
color:#0000FF;
font-family:Arial;
font-weight:700;
font-size:11pt;
}
</style>
</HEAD>

<BODY>
<form>
<textarea cols="44" rows="12"></textarea>
</form>

Or using classes:

<style type="text/css">
textarea.customT{
background-image:url(blue_saturn.jpg);
background:#000000;
color:#0000FF;
font-family:Arial;
font-weight:700;
font-size:11pt;
}
</style>
</HEAD>

<BODY>
<form>
<textarea class="customT" cols="44" rows="12"></textarea><br>
<textarea cols="44" rows="12"></textarea>
</form>

.....Willy

Edit: Added working example(s).

me'
12-29-2003, 01:59 PM
Originally posted by Philip M
Ah, yes, but it works!

"Deprecated" tags etc. will be around for a long, long time yet.
There are far too many web pages already in existence.
But suggestions for changing it into css will be very welcome. Yes, but they'll be around for even longer if people keep using them! <font> tags + text only browsers, or other alternative user agents = :confused:.

Philip M
12-29-2003, 06:34 PM
Someone pointed out to me that the quality of the carpentry I normally achieve in manufacturing garden nesting boxes is of no interest whatsoever to the birds. It is valued and admired only by the creator of the nesting boxes, not the user. Any rough old thing will be entirely satisfactory for them.

The same applies to web pages. 99.9% of users do not care
a jot whether the page uses <font>, css style sheets, classes or whatever. They care only that it works.

Of course, it is always better to use the most correct and up-to-date methods in new work, as opposed to modifying the old.

May 2004 bring peace and prosperity to all. Or, as the Scots might say, "Lang mae ye auld sporran reek o' porridge!"

me'
12-29-2003, 09:33 PM
The same applies to web pages. 99.9% of users do not care
a jot whether the page uses <font>, css style sheets, classes or whatever. They care only that it works. That means you'll be alienating 0.1% of users for no reason.
Superfluous markup results in bigger file sizes, therefore bigger bandwidth and therefore bigger costs eventually.
The fact of the matter is that depreciated tags will eventually drop out of usage. Future-proof your code by coding with the new standards.
Seperating the style and content means you can code in XML, which in turn means better interoperabillity, semantic code, and less ambiguity through stricter type.

Willy Duitt
12-29-2003, 09:59 PM
Originally posted by Philip M
Someone pointed out to me that the quality
of the carpentry I normally achieve in manufacturing garden
nesting boxes is of no interest whatsoever to the birds. It is
valued and admired only by the creator of the nesting boxes, not
the user. Any rough old thing will be entirely satisfactory for
them.

No offense intended Philip :)

But could that someone have been a person whom
justified his shoddy work with that lame arguement?

It may be true the birds don't give a hoot :D
But a well constructed nesting box will sell much quicker
and demand a higher price than Any rough old thing....

.....Willy

BTW: Did the styles work for you? :p

brothercake
12-30-2003, 12:27 AM
Your analogy is not particularly accurate - the birds do care - they care when they get wood splinters in their feathers and hurt their feet on the rough edges.

In any case it isn't 99.9% - 0.1%. It's more like 80/20.

Paul Jr
12-30-2003, 03:21 AM
Heheh, sorry for the bad vibes, people. I took to CSS right quick and I can never see how anyone would even use anything different -- I tend to get emotional. ;).

Also, I didn't see the need for the JS, unless hvadseth79 wanted the background color to change when the text box is selected. I didn't catch if he wanted that or not from his post.

jkd
12-30-2003, 03:51 AM
Originally posted by Paul Jr
Also, I didn't see the need for the JS, unless hvadseth79 wanted the background color to change when the text box is selected. I didn't catch if he wanted that or not from his post.

input:focus {
background: newcolor;
}

.... still no need for Javascript.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum