We help IT Professionals succeed at work.

Changing the font size of an input text box

jagku
jagku asked
on
Hello Experts,

I have the following html/css:

<html><head>
<style>
input[type="text"] {
	font: 11px "Helvetica Neue", Helvetica, Arial, sans-serif;
	border: 1px solid #444;
	}
</style>
</head>
<body>
<input type="text" />
</BODY></HTML>

Open in new window



However, it is ignoring the font size.
How can I get it to use the font size?

Thanks
Comment
Watch Question

Top Expert 2013

Commented:
try using the more specific declaration font-size:11px;

Some times aggregated properties are not fully applied.


Cd&

Author

Commented:
Hi,

No - I tried this earlier and it was ignored.

i.e.
<html><head>
<style>
input[type="text"] {
	font-size: 11px;
	FONT-FAMILY: "Helvetica Neue", Helvetica, Arial, sans-serif;
	border: 1px solid #444;
	}
</style>
</head>
<body>
<input type="text" />
</BODY></HTML>

Open in new window


Thanks
Top Expert 2013

Commented:
Which browser are you using?


Cd&
Top Expert 2013
Commented:
If you are using IE you will have to change the rule because IE does not know what the square brackets mean and will ignore [type="text"]


You will need to use an id or class


Cd&
Top Expert 2013
Commented:
I just ran across some documentation that might help.  It may work for IE if you use a valid DOCTYPE

Try
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

Open in new window



Cd&

Author

Commented:
Many Thanks!

Explore More ContentExplore courses, solutions, and other research materials related to this topic.