Click to See Complete Forum and Search --> : problem: div class="test" can't front select


minhkhoi
10-15-2006, 11:16 PM
I have code like this:

<head>
<style>
.test{
position: absolute;
top:0px;
left:0px;
background-color:buttonface;
z-index:1
}
</style>
</head>

<body>
<select name="select" id="mk">
<option value="Test">Test</option>
</select>

<div class="test">test test test test test test<BR> test test test test test test</div>
</body>
</html>




Now I want div front the select, but I don't know what should I do. Try z-index but not success.

Any boy help me?

Thanks for reading

mark_yieh
10-16-2006, 12:11 AM
hmm I'm guessing you're having problems in IE right? (what else is new). Here is the reason why.

http://www.webreference.com/programming/javascript/form/

Read that and you should get an idea of what is going on. The best solution, as stated in the article is to use display: hidden. Well good luck. Also if you did a search in this forum about z-index, you'll find other related discussions which will give you insight to the problem you are having.

felgall
10-16-2006, 01:59 AM
selects in IE, iframes in some versions of Opera, and Flash everywhere always appears in front of everything else on the page. THe only way to put other things in front of them is to hide the select/iframe/flash that you want to overlay something else in front of.

Kravvitz
10-16-2006, 02:11 AM
Really? Felgall, take a look at this demo: Select Element Layering Bug Fix (http://www.dynamicsitesolutions.com/demos/select_element_layering_bug_fix.php). :D

minhkhoi
10-16-2006, 07:30 AM
Thanks everybody. You'are so nice.
I find solution, just hide <select> is OK.

Thanks again

WebJoel
10-16-2006, 08:17 AM
Re:
Now I want div front the select, but I don't know what should I do. Try z-index but not success....Thanks for reading

You probably won't, either. A "position:absolute;" will not accept a z-index: higher than default ("1"?). You can only 'z-index:n' a "position:relative;" element.
There is some quirky thing with Opera that requires a "z-index:1;" when "position:absolute;" is declared so that a background 'hack' functions, but that is a fluke, although the link above seems to show otherwise.... Hmm. (And it's a shame that that drop-down menu on that page doesn't work my IE, but Firefox. -Must some glitch there...)
I'm a little unclear, -is 'default' z-index: "0", or "1". I always start from & assume "1" because only IE understands "negative" z-indexes and I want to avoid the headaches of maybe getting it wrong.

-But I had to ask: What is:

<style>
.test{
position: absolute;
top:0px;
left:0px;
background-color:buttonface;
z-index:1
}
</style>
That's not any color that I am aware of... :confused:

minhkhoi
10-16-2006, 08:25 AM
Thanks about:

You probably won't, either. A "position:absolute;" will not accept a z-index: higher than default ("1"?). You can only 'z-index:n' a "position:relative;" element.

They are useful for me

I don't know this color after I try and see :D :
You can try:


<html>
<head>
<style>
.yToolbar {
BACKGROUND-COLOR: buttonface;
}
</style>
</head>
<body>
<div class="yToolbar">New color :D</div>
</body>
</html>


P.S: I use IE

Kravvitz
10-16-2006, 03:57 PM
There is some quirky thing with Opera that requires a "z-index:1;" when "position:absolute;" is declared so that a background 'hack' functions, but that is a fluke, although the link above seems to show otherwise.... Hmm. (And it's a shame that that drop-down menu on that page doesn't work my IE, but Firefox. -Must some glitch there...)
I think they may have fixed that Opera bug.

I'm a little unclear, -is 'default' z-index: "0", or "1". I always start from & assume "1" because only IE understands "negative" z-indexes and I want to avoid the headaches of maybe getting it wrong.
The CSS2 specs say that negative z-indexes are allowed. IE4+/Win and Opera (at least 5+) supports negative z-indexes. Firefox does not. I haven't this tested in non-Windows browsers yet.

That's not any color that I am aware of... :confused:
ButtonFace is a system color. (http://www.w3.org/TR/REC-CSS2/ui.html#system-colors)

minhkhoi
10-16-2006, 07:56 PM
ButtonFace is a system color. (http://www.w3.org/TR/REC-CSS2/ui.html#system-colors)

Thanks about this link. There are something very useful for me.
Thanks a lot