Skip to content Skip to sidebar Skip to footer

Focusing And One Element Should Reflect To Another Element In Css

I'm working with CSS styling. Coming to my case. If I focus on input element then the border of a div which is completely outside of that div (which contains input element) should

Solution 1:

Please remove comma ,. This will apply border to div next to input focused.

input[type=email]:focus +  div.emailicon
{
    border-color: #e86740;
    box-shadow: none;
    outline: none;
}

Solution 2:

How about trying this one?

div.emailicon { 
     border: 3px solid; 
}

input[type=email]:focus +  div.emailicon
{
    border-color: #e86740;
    box-shadow: none;
    outline: none;
}

Here is the js fiddle you can check it out.

Edited: I change back the , into + as I realise that I made a silly mistake, now it should works finely, which means your initial codes are working fine. Apologise for my silly mistake.

Post a Comment for "Focusing And One Element Should Reflect To Another Element In Css"