Hobhouse
Hobhouse

Reputation: 16283

How do I vertically align text in an input field in Firefox?

Using this code firefox 3.5.9 will display input text in the top part of the input field. Safari and Opera will center it.

How do I make Firefox align the text like the other two browsers?

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <title>Test</title>
    <style type="text/css">
        #q {
            padding:0;
            height: 30px;
            font-size:18px;
            line-height:20px;
        }
    </style>
</head>
<body>
<input type="text" value="Text alignment" id="q">    
</body>
</html>  

Upvotes: 0

Views: 467

Answers (1)

matpol
matpol

Reputation: 3074

forget the height and just set padding to give the height you are after.

Upvotes: 1

Related Questions