This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Stylesheets > August 2004 > setting textarea font to match rest





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author setting textarea font to match rest
Chris Sharman

2004-08-21, 7:25 pm

I haven't specified fonts, leaving the user to have their chosen font.

However, different tags render in different default fonts: text, input,
& textarea all different from one another. I guess this is normal
behaviour, but it looks poor, and I don't want our website to look that
way (to out of the box browsers).

How would I set textarea's 'like' input, or how would I determine
(Javascript?) what's being used by an input field, to set the textarea
the same ? If it's got to be javascript, is there a way to set style for
all textareas together, rather than individual textareas ?

The difference between input boxes & text is bearable, if necessary, but
the textarea default font stands out too much.

Thanks,
Chris
Els

2004-08-23, 7:19 pm

Chris Sharman wrote:

> I haven't specified fonts, leaving the user to have their
> chosen font.
>
> However, different tags render in different default fonts:
> text, input, & textarea all different from one another. I
> guess this is normal behaviour, but it looks poor, and I
> don't want our website to look that way (to out of the box
> browsers).
>
> How would I set textarea's 'like' input, or how would I
> determine (Javascript?) what's being used by an input
> field, to set the textarea the same ? If it's got to be
> javascript, is there a way to set style for all textareas
> together, rather than individual textareas ?
>
> The difference between input boxes & text is bearable, if
> necessary, but the textarea default font stands out too
> much.


Didn't try this, but how about
body,input,textarea{
font-family:Helvetica,sans-serif;
font-size:100%;
}
?

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Jay-Z - Excuse Me Miss feat Pharrell
Els

2004-08-23, 7:19 pm

Chris Sharman wrote:

> Els wrote:
>
> Sorry - I wasn't clear -


Yes you were

> I don't want to overrule all
> users' font choices - I want to leave body alone, and have
> textarea 'like' body, and maybe input & select too.


I did get that, just didn't think of a solution without having
to use at least a generic font... (don't know why I put the
Helvetica in :S)

> Sort of textarea { font-family: inherit }
> hmm - just tried that - answered my own question - sorry
> for wasting everybody's time !!


Didn't waste it, you provided other people (like myself) with
a solution to future problems :-)

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Legião Urbana - HIGH NOON
Chris Sharman

2004-08-23, 11:16 pm

Els wrote:
> Chris Sharman wrote:
>
> Didn't try this, but how about
> body,input,textarea{
> font-family:Helvetica,sans-serif;
> font-size:100%;
> }

Sorry - I wasn't clear - I don't want to overrule all users' font
choices - I want to leave body alone, and have textarea 'like' body, and
maybe input & select too.

Sort of textarea { font-family: inherit }
hmm - just tried that - answered my own question - sorry for wasting
everybody's time !!

Chris
Chris Sharman

2004-08-26, 12:27 pm

Chris Sharman wrote:

> Els wrote:
>
> Sorry - I wasn't clear - I don't want to overrule all users' font
> choices - I want to leave body alone, and have textarea 'like' body, and
> maybe input & select too.
>
> Sort of textarea { font-family: inherit }
> hmm - just tried that - answered my own question - sorry for wasting
> everybody's time !!


Spoke too soon - doesn't work in IE. Fixes Mozilla though.

Chris
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews