Re: CSS for pull-down menus?

by "Darrell King" <darrell(at)webctr.com>

 Date:  Thu, 4 Oct 2001 10:23:04 -0400
 To:  <hwg-techniques(at)hwg.org>
 References:  design
  todo: View Thread, Original
You can use CSS to control these things in compliant browsers, such as
IE5.5.  A workaround that allows you to size the menus similarly is to match
the CSS up with the older HTML attributes.  Compliant browsers will use the
CSS, while non-compliant use the attributes.  I haven't tried this with drop
lists, but with text boxes you can do:

<. input type='text' size='25' name='blah' value='' class='text200' />

Then, in your stylesheet, define the class:

.text200 { width: 200 }

Now, finally, access the page side-by-side in IE5.5 and NN4.x, and change
the size attribute and/or CSS width setting until the fields look similar.

You can also set background and text colors, heights, and other properties
for the CSS version.  NN4.x will just ignore the whole class.  This is fine,
because NN users won't expect anything but plain form displays anyway, as
the browser is way too old to ever have delivered anything else.  At least
your form layout will look similar in both.

Needless to say, trying to control the layout across many different browsers
with one technique is a plan with limitations.  A more comprehensive
approach would be to detect the browser type with something like PHP (my
preference) and deliver an appropriate stylesheet from a set.  In this way,
you could provide backwards compatibility for outdated browsers as well as
deliver more pretties for newer software.

My advice would be to begin with the first plan for immediate gratification
while researching the second option in more detail...:)

D



----- Original Message -----
From: "Dane Robison" <dane(at)strategic-design.com>
To: <hwg-techniques(at)hwg.org>
Sent: Thursday, October 04, 2001 9:19 AM
Subject: CSS for pull-down menus?


I'm hoping against all hope that someone has an idea for this:

I have a real problem with the way Netscape displays a wider pull-down menu
than MSIE (at least on a Mac). Is there a way to control the font and size
of the option items listed in a pull-down? If someone can direct me to a way
to use a smaller size in these menus, I would be eternally grateful!

Thanks!
Dane

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA