Easiest way to ensure the same font and font size in labels, inputs and textareas

I have a page where I combine labels, input fields and textareas to display some content. I would like them all to have the same font family and font size. I've been playing around with font-family: inherit style, but that doesn't seem to work for input and text areas. Which would be the easiest way to ensure the same font / size throughout the page.

+1


source to share


3 answers


Ok ... this does the trick:



*
{
    font-family: arial;
}

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

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

      

+3


source


My CSS makes sense as I haven't used it for some time, but I believe that

*
{
    font-family: arial;
}

      



will apply to everyone.

+1


source


I think most CSS developers will do something like

body {font: normal 10pt Arial}

      

At the top of the CSS file.

If you want to change the shortcuts, just add

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

      

somewhere along the road.

0


source







All Articles