...

View Full Version : Safari hover css bug - how do i avoid it



Jesper Møller
06-21-2010, 06:46 PM
I have a fieldset like this:


<fieldset class="display-options">
......
......
<label>
<select name="sd" id="sd">
<option value="a">Stigende</option>
<option value="d" selected="selected">Faldende</option>
</select>
<input type="submit" name="sort" value="Udfør" class="button2" />
</label>
</fieldset>

for the styleing i have this:

select, input {
color: #cccc00;
border-color: #cccc00;
background-color: #581e00;
}

select:hover {
color: #ecb012;
border-color: #ecb012;
}

select:focus {
color: #00ffff;
border-color: #00ffff;
}

input.button2 {
color: #cccc00;
border-color: #cccc00;
background-color: #581e00;
background-image: none;
}

input.button2:hover, input.button2:active {
color: #ecb012;
border-color: #ecb012;
}


the problem in safari is that when i hover the input button the select hoverstate is activated ... Anny ider on how i bypass/fix this ??

hdewantara
06-23-2010, 05:28 PM
Hi,
I tested your script w/o "<label>" and it worked well.
What is it doing there for?

Jesper Møller
06-23-2010, 05:35 PM
Its a phpBB3 forum (proSilver theme) forum thag im working on a nother style for ...
So i have not written the code ... only trying to restyle it ...
The the label is used for some setup in the theme

But im wondering why hovering the select box trikkers the hoverstate on the input box

only happning in safari (mac osx/safari 5)

hdewantara
06-23-2010, 06:09 PM
Hm, not sure but probably has something to do with focusing...
http://www.w3.org/TR/html401/interact/forms.html#h-17.9.1:

#1. To associate a label with another control implicitly,
the control element must be within the contents of the LABEL element.
In this case, the LABEL may only contain one control element...

#2. When a LABEL element receives focus,
it passes the focus on to its associated control...

#3. Labels may be rendered by user agents in a number of ways...

So no wonder that while this phpBB3 implicit-type label contains 2 controls,
it is your browser who decide which control the label should be associated with...
probably.:confused:

Is it possible to wrap only 1 control ?

Jesper Møller
06-23-2010, 11:39 PM
Is it possible to wrap only 1 control ?

i wish it was... but im supposed to only work in the css filse .. not the templates


So no wonder that while this phpBB3 implicit-type label contains 2 controls,
it is your browser who decide which control the label should be associated with...
probably.

think you right ...
annoying but i may have to live with it :mad:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum