Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder Jesper Møller's Avatar
    Join Date
    Jun 2006
    Location
    Denmark, Copenhagen
    Posts
    138
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Safari hover css bug - how do i avoid it

    I have a fieldset like this:

    Code:
    <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:
    Code:
    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 ??
    "True knowledge exists in knowing that you know nothing."

    "Education is learning what you didn't even know you didn't know!"

  • #2
    Regular Coder hdewantara's Avatar
    Join Date
    Aug 2009
    Location
    Jakarta, Indonesia.
    Posts
    361
    Thanks
    9
    Thanked 53 Times in 52 Posts
    Hi,
    I tested your script w/o "<label>" and it worked well.
    What is it doing there for?

  • #3
    Regular Coder Jesper Møller's Avatar
    Join Date
    Jun 2006
    Location
    Denmark, Copenhagen
    Posts
    138
    Thanks
    9
    Thanked 0 Times in 0 Posts
    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)
    "True knowledge exists in knowing that you know nothing."

    "Education is learning what you didn't even know you didn't know!"

  • #4
    Regular Coder hdewantara's Avatar
    Join Date
    Aug 2009
    Location
    Jakarta, Indonesia.
    Posts
    361
    Thanks
    9
    Thanked 53 Times in 52 Posts
    Hm, not sure but probably has something to do with focusing...
    http://www.w3.org/TR/html401/interac....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.

    Is it possible to wrap only 1 control ?
    Last edited by hdewantara; 06-23-2010 at 05:21 PM.

  • #5
    Regular Coder Jesper Møller's Avatar
    Join Date
    Jun 2006
    Location
    Denmark, Copenhagen
    Posts
    138
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by hdewantara View Post
    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
    "True knowledge exists in knowing that you know nothing."

    "Education is learning what you didn't even know you didn't know!"


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •