473,379 Members | 1,335 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Height of selectbox element

I'm working with a requirement to make a selectbox the same height as
normal text input elements. (at least for IE7)

But in IE the selectbox reacts strangely to the CSS rules. Normally,
there are so many things not possible with select boxes in IE.

But the I discovered I could actually change the height by adjusting
font-size, then adjusting height I was actually able to tweak the
height.

I had to adjust the height up to 14px and then use the height
attribute to be able to adjust the height of the selectbox. (all other
text is 11px).

That made select boxes look horrible in Firefox, as it correctly
understands height, etc, of the select box.

Then I thought about first adjusting the select element, then re-
adjusting the option element, but the option element did not seem to
react... (it appears that when styling option elements, I'm styling
what compares to the "open" selectbox. The "closed" element is still
only the select element).

My question is: Do you know where I can find more info on setting the
height correctly of a select box so that it appears similar cross-
browser (FF and IE7)?

Any links and info is greatly appreciated.

/Jesper Rønn-Jensen
blog: www.justaddwater.dk

Oct 15 '07 #1
3 22267
Also sprach Jesper Rønn-Jensen:
My question is: Do you know where I can find more info on setting the
height correctly of a select box so that it appears similar cross-
browser (FF and IE7)?
I think the simplest approach would be to use Conditional Comments to
include an extra stylesheet for IE. Within that stylesheet, you can then use
various CSS hacks to address specific IE versions. This way you can feed any
necessary correction rules to any IE version.

<link rel="stylesheet" type="text/css" href="common.css">
<!--[if IE]><link rel="stylesheet" type="text/css"
href="ie.css"><![endif]-->

Put standards compliant code in common.css and any fixes for IE into ie.css.

Greetings,
Thomas

--
C'est pas parce qu'ils sont nombreux à avoir tort qu'ils ont raison!
(Coluche)
Oct 15 '07 #2
Jesper Rønn-Jensen wrote:
.. (all other text is 11px).
Before you venture further, please read this:
http://k75s.home.att.net/fontsize.html

--
-bts
-Motorcycles defy gravity; cars just suck
Oct 15 '07 #3
Jesper Rønn-Jensen wrote:
I'm working with a requirement to make a selectbox the same height as
normal text input elements. (at least for IE7)
That's something only a marketing pinhead or deeziner might consider a
"requirement". If they understood web media, it wouldn't even cross
their minds.
I had to adjust the height up to 14px and then use the height
attribute to be able to adjust the height of the selectbox. (all other
text is 11px).
Hmmm... I wonder how it will all adapt to my 17px minimum font size?
Care to guess how unreadable it will be?

--
Berg
Oct 15 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tole | last post by:
hi all, i've got a selcetbox (multiple) which is filled by javascript. only problem is that i have aprox 1000 options to add to that select, and that adding lasts for 5-6 seconds. Even...
14
by: delerious | last post by:
I need to determine an element's width and height in pixels (not including padding, border, and margin) in Javascript. The element will not have width or height styles specified. In Mozilla, I...
12
by: Stanimir Stamenkov | last post by:
Here are two cases regarding inline-level elements' line-height, padding and background, which I doesn't understand: <div style="background: black; color: white; line-height: 1.5">...
5
by: Secret Guy | last post by:
Because of my experience posting various places over the last couple of weeks: I'm expecting to be greated with hostility for asking about concepts instead of "practical" things, since that has...
3
by: Stefan Richter | last post by:
I would like to fill a Selectbox dynamically. I am taking all values from a db, and fill them into a selectbox. I guess the best way was to use some kind of a dynamical array, where you don't have...
1
by: shankwheat | last post by:
I've been using this little script to change the <a href=""></a> value of a link which works well. <script language="javascript" type="text/javascript"> function ordering(sorder) { var link =...
4
by: shankwheat | last post by:
I'm passing a string like 'Div3,Div4' to use as options in a selectbox but I need the text the user sees in the box different from the values. My code populates the values in the selectbox...
1
by: giloosh | last post by:
i would like to dynamically output such a selectbox below using php and mysql: <select> <option< 100 </option> <option100 to 150 </option> <option150 to 200 </option> <option200 to 250...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.