tags:

views:

236

answers:

3

I have a page where I combine labels, input boxes and text areas to display some content. I would like all of them to have the same font-family and font-size. I have played with the font-family: inherit style but this doesn't seem to work for the input and text areas. What would be the easiest way to ensure the same font / size over the whole page.

+1  A: 

My CSS is iffy as I haven't used it in some time, but I believe doing

*
{
    font-family: arial;
}

will apply to all.

PhoenixRedeemer
Nope .. the font in input box-es doesn't change.
Drejc
Something must be overriding it then later. I just tried it on a web-page that was bare except for that style and an input and it resized it.
PhoenixRedeemer
Can be ... my page is really complex in design and style.
Drejc
I will mark this as correct, as it helped solving the problem. Thanks!
Drejc
+1  A: 

Ok ... this does the trick:

*
{
    font-family: arial;
}

input
{
    font-family: inherit;
    font-size: 100%
}

textarea
{
    font-family: inherit;
    font-size: 100%
}
Drejc
A: 

I think most CSS devs will do something like

body {font: normal 10pt Arial}

At the top of the CSS file.

If you want to change labels from this, just add a

label, input, textarea {font-family:Georgia}

somewhere down the road.

Triptych
the input and text areas will still have their own fonts.
Drejc
Ah, I think I slightly misunderstood her question. Editing.
Triptych