Font size on selects

T

tshad

I have a select tag that displays as about 12px even though my table and td
tags are set to 10px.

This is from my .css file

html,body {
margin:0;
padding:0;
font-family:Verdana, Arial, Helvetica, sans-serif 100%;
}
table {
font-family: Verdana, Arial, Helvetica, sans-serif 100%;
font-size:10px;
}
th {
background-color:#2FABAD;
color:white;
text-decoration: none;
border-style:none;
vertical-align:bottom;
font-size:14px;
}
td {
font-size: 10px;
text-decoration: none;
vertical-align:baseline;
empty-cells: show;
}

I have to specifically set

select {
font-size:10px;
}

to get it to the size I want.

Why doesn't the table and td tags cover it?

Do I need to set every possible type of tag to 10 if I want it that way?

Thanks,

Tom
 
B

Beauregard T. Shagnasty

tshad said:
I have a select tag that displays as about 12px even though my table and td
tags are set to 10px.

This is from my .css file

html,body {
margin:0;
padding:0;
font-family:Verdana, Arial, Helvetica, sans-serif 100%;

100% is not a font family. Chances are your browser is ignoring this
(these) incorrect styles.
}
table {
font-family: Verdana, Arial, Helvetica, sans-serif 100%;
font-size:10px;
}
th {
background-color:#2FABAD;
color:white;
text-decoration: none;
border-style:none;
vertical-align:bottom;
font-size:14px;
}
td {
font-size: 10px;
text-decoration: none;
vertical-align:baseline;
empty-cells: show;
}

I have to specifically set

select {
font-size:10px;
}

to get it to the size I want.

How about the size your visitor would like? Use percentages instead of
pixels.

Some browsers default form elements to about 90% of the inherited size.
Why doesn't the table and td tags cover it?

Do I need to set every possible type of tag to 10 if I want it that way?

No. I would recommend the following:

body, td, input, select {
font: 100% Helvetica, Arial, sans-serif;
}

Add additional specifics for other elements. text-decoration: none
doesn't make sense for table cells.
 
J

Joel Shepherd

tshad said:
I have a select tag that displays as about 12px even though my table and td
tags are set to 10px.

Maybe the select tags are revolting and trying to use a font size that
your visitors can actually read?

Pixels are not a good choice for font-size (even ignoring issues with
trying to specify an absolute font-size, period). Since you don't know
the display characteristics of your visitor's monitor -- e.g., what its
dpi setting is -- you don't know if 10px is easily readable or, as some
of our more outspoken friends call it, fliegenscheiße (do look it up).

Consider using the amazing em unit (google that as well), and
configuring your *browser* so that 1em fonts appear at a size that you
like. Then you and your visitors will be elated by your fine taste in
font presentation.

Oh, and there's some info here on styling forms, including (apparently)
problematic select elements:
http://www.cs.tut.fi/~jkorpela/forms/present.html

--
Joel.

This time around,
the revolution will
not be televised.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top