Connecting Tech Pros Worldwide Help | Site Map

Fonts

Daviso
Guest
 
Posts: n/a
#1: Feb 8 '06
Hi.

I would like to know how to chage the font size into a textarea??

Anybody knows about it???

Thanks.



Erwin Moller
Guest
 
Posts: n/a
#2: Feb 8 '06

re: Fonts


Daviso wrote:
[color=blue]
> Hi.
>
> I would like to know how to chage the font size into a textarea??
>
> Anybody knows about it???
>
> Thanks.[/color]

Did you try to set it?
Like:
<textarea style="font-size:23">Hai</textarea>

Regards,
Erwin Moller
Daviso
Guest
 
Posts: n/a
#3: Feb 8 '06

re: Fonts


Nop, but I'll try it, thanks

"Erwin Moller"
<since_humans_read_this_I_am_spammed_too_much@spam yourself.com> escribió en
el mensaje news:43e9ee9b$0$11074$e4fe514c@news.xs4all.nl...[color=blue]
> Daviso wrote:
>[color=green]
>> Hi.
>>
>> I would like to know how to chage the font size into a textarea??
>>
>> Anybody knows about it???
>>
>> Thanks.[/color]
>
> Did you try to set it?
> Like:
> <textarea style="font-size:23">Hai</textarea>
>
> Regards,
> Erwin Moller[/color]


David Dorward
Guest
 
Posts: n/a
#4: Feb 8 '06

re: Fonts


Erwin Moller wrote:
[color=blue]
> <textarea style="font-size:23">Hai</textarea>[/color]

23 what? Non-zero lengths require units. (And px/pt are poor choices for use
on screen).

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
oliver.saunders@gmail.com
Guest
 
Posts: n/a
#5: Feb 8 '06

re: Fonts


Use percentages ( font-size: 80%; ) that way you don't break the text
size features in IE

Lasse Reichstein Nielsen
Guest
 
Posts: n/a
#6: Feb 8 '06

re: Fonts


Erwin Moller <since_humans_read_this_I_am_spammed_too_much@spam yourself.com> writes:
[color=blue]
> Daviso wrote:
>[color=green]
>> Hi.
>>
>> I would like to know how to chage the font size into a textarea??
>>
>> Anybody knows about it???
>>
>> Thanks.[/color]
>
> Did you try to set it?
> Like:
> <textarea style="font-size:23">Hai</textarea>[/color]

If that doesn't work (which is likely if the browser is in standards
mode) add a unit to the size value, e.g.,
<textarea style="font-size:23px">Hai</textarea>
The unit is required by CSS.

Using "px" for fonts is rarely a good idea, though, since you have no
idea how readable a specific number of pixels is on a screen without
knowing both screen resolution and size (and it prevents some browsers
from scaling the font, so if it's unreadable, it's really
unreadable!). It's better to use, e.g., "120%" or "1.2em" to get a
font that is 20% larger than the user's default font.

/L
--
Lasse Reichstein Nielsen - lrn@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Erwin Moller
Guest
 
Posts: n/a
#7: Feb 9 '06

re: Fonts


Lasse Reichstein Nielsen wrote:
[color=blue]
> Erwin Moller
> <since_humans_read_this_I_am_spammed_too_much@spam yourself.com> writes:
>[color=green]
>> Daviso wrote:
>>[color=darkred]
>>> Hi.
>>>
>>> I would like to know how to chage the font size into a textarea??
>>>
>>> Anybody knows about it???
>>>
>>> Thanks.[/color]
>>
>> Did you try to set it?
>> Like:
>> <textarea style="font-size:23">Hai</textarea>[/color]
>
> If that doesn't work (which is likely if the browser is in standards
> mode) add a unit to the size value, e.g.,
> <textarea style="font-size:23px">Hai</textarea>
> The unit is required by CSS.
>
> Using "px" for fonts is rarely a good idea, though, since you have no
> idea how readable a specific number of pixels is on a screen without
> knowing both screen resolution and size (and it prevents some browsers
> from scaling the font, so if it's unreadable, it's really
> unreadable!). It's better to use, e.g., "120%" or "1.2em" to get a
> font that is 20% larger than the user's default font.
>
> /L[/color]


Yes of course. Stupid cunfusing typo.
I didn't mention what 23. :P
I ment 23px.

But I just tested 23 without anything. To my surprise 23 worked in both
Firefox and IE. I think they default to px when the coder is too stupid to
mention what he means, like me. ;-)

Well, sorted out now. :-)
Thanks for correcting.

Regards,
Erwin Moller

VK
Guest
 
Posts: n/a
#8: Feb 9 '06

re: Fonts



Erwin Moller wrote:[color=blue]
> But I just tested 23 without anything. To my surprise 23 worked in both
> Firefox and IE. I think they default to px when the coder is too stupid to
> mention what he means, like me. ;-)[/color]

Not sure what's wrong with your Firefox (check the version and see if
the relevant bug was reported for this version).

Your IE was in quirk mode, this is why it did work. Simply add at the
very top of your document:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html401/loose.dtd">

and try again to see the difference.

Thomas 'PointedEars' Lahn
Guest
 
Posts: n/a
#9: Feb 9 '06

re: Fonts


Lasse Reichstein Nielsen wrote:
[color=blue]
> Using "px" for fonts is rarely a good idea, though, since you have no
> idea how readable a specific number of pixels is on a screen without
> knowing both screen resolution and size[/color]

True, however `em' or `%' is more difficult to implement than `px'.
[color=blue]
> (and it prevents some browsers from scaling the font, so if it's
> unreadable, it's really unreadable!).[/color]

/Some/ browsers? Which other browsers but IEeek(-based)?


PointedEars
Dr John Stockton
Guest
 
Posts: n/a
#10: Feb 9 '06

re: Fonts


JRS: In article <dscn3a$369$1@hefestos.uned.es>, dated Wed, 8 Feb 2006
12:11:51 remote, seen in news:comp.lang.javascript, Daviso
<dhernande7@alumno.uned.es> posted :
[color=blue]
>I would like to know how to chage the font size into a textarea??[/color]

AFAICS, what you have so far been given is not javascript.
AFAICS, what you have so far been given does not change the size, but
creates the area with a non-default size. You can use such as

F.Code.style.fontSize = "23pt"
F.Code.style.fontSize = "123%"

in javascript to change the font size of the textarea F.Code .

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
John W. Kennedy
Guest
 
Posts: n/a
#11: Feb 9 '06

re: Fonts


Thomas 'PointedEars' Lahn wrote:[color=blue]
> Lasse Reichstein Nielsen wrote:
>[color=green]
>> Using "px" for fonts is rarely a good idea, though, since you have no
>> idea how readable a specific number of pixels is on a screen without
>> knowing both screen resolution and size[/color]
>
> True, however `em' or `%' is more difficult to implement than `px'.
>[color=green]
>> (and it prevents some browsers from scaling the font, so if it's
>> unreadable, it's really unreadable!).[/color]
>
> /Some/ browsers? Which other browsers but IEeek(-based)?[/color]

Huh? I thought 'px' did that by definition?

--
John W. Kennedy
"But now is a new thing which is very old--
that the rich make themselves richer and not poorer,
which is the true Gospel, for the poor's sake."
-- Charles Williams. "Judgement at Chelmsford"
Thomas 'PointedEars' Lahn
Guest
 
Posts: n/a
#12: Feb 9 '06

re: Fonts


John W. Kennedy wrote:
[color=blue]
> Thomas 'PointedEars' Lahn wrote:[color=green]
>> Lasse Reichstein Nielsen wrote:[color=darkred]
>>> Using "px" for fonts is rarely a good idea, though, since you have no
>>> idea how readable a specific number of pixels is on a screen without
>>> knowing both screen resolution and size[/color]
>>
>> True, however `em' or `%' is more difficult to implement than `px'.
>>[color=darkred]
>>> (and it prevents some browsers from scaling the font, so if it's
>>> unreadable, it's really unreadable!).[/color]
>>
>> /Some/ browsers? Which other browsers but IEeek(-based)?[/color]
>
> Huh? I thought 'px' did that by definition?[/color]

Well, I think it depends on how you define "resolution of the viewing
device" and "If the pixel density of the output device is very different
from that of a typical computer display, the user agent should rescale
pixel values." in the CSS Specifications :) The reference pixel is a
SHOULD, not a MUST.

Gecko-based, Opera-based and KHTML-based browsers allow you to zoom text if
the font size is specified in `px', and they allow for setting a minimum
font size specified in `px'. Opera (and as I have heard IE 7 Beta 2 too)
even allow you to zoom the entire client area, including images etc. I
consider that to be a Good Thing; not because I consider using `px' for
font sizes a Good Thing, though.


X-Post & F'up2 ciwas

PointedEars
Erwin Moller
Guest
 
Posts: n/a
#13: Feb 10 '06

re: Fonts


VK wrote:
[color=blue]
>
> Erwin Moller wrote:[color=green]
>> But I just tested 23 without anything. To my surprise 23 worked in both
>> Firefox and IE. I think they default to px when the coder is too stupid
>> to mention what he means, like me. ;-)[/color]
>
> Not sure what's wrong with your Firefox (check the version and see if
> the relevant bug was reported for this version).
>
> Your IE was in quirk mode, this is why it did work. Simply add at the
> very top of your document:
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html401/loose.dtd">
>
> and try again to see the difference.[/color]

Yep,

You are right.

Erwin Moller
Closed Thread