Font size on selects

Discussion in 'HTML' started by tshad, Mar 29, 2005.

  1. tshad

    tshad Guest

    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
    tshad, Mar 29, 2005
    #1
    1. Advertising

  2. tshad wrote:
    > 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.

    --
    -bts
    -This space intentionally left blank.
    Beauregard T. Shagnasty, Mar 29, 2005
    #2
    1. Advertising

  3. "tshad" <> wrote:

    > 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.
    Joel Shepherd, Mar 29, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andreas Klemt
    Replies:
    6
    Views:
    10,969
    Peter Theill
    Nov 28, 2004
  2. dave richards
    Replies:
    2
    Views:
    593
    Paul Furman
    Feb 19, 2004
  3. Wongod
    Replies:
    2
    Views:
    687
  4. wial
    Replies:
    2
    Views:
    789
  5. mttc
    Replies:
    2
    Views:
    2,352
    Roedy Green
    Jul 3, 2009
Loading...

Share This Page