Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i


Hi Guys!!

I need some clarification regarding the HTML css issue that I am stuck with.

I have an ul Li structure in my HTML page with an anchor tag within the
  • . When the keyboard focus comes to the anchor tag the outline is not getting set on the anchor tag only in IE browser whereas it works fine in chrome and Firefox browsers. No matter what I do it just doesn't get set!!

    I have tried almost all solutions that I could Google out, like adding background url to the anchor tag with empty image, explicitly setting outline through javascript onfocus of anchor etc etc.

    But it just doesn't work.

    Could you please help me with this issue and guide me correctly about what could have gone wrong!!!

    All your suggestions are appreciated!!

    Thanks in advance.

    Have a great day!!

    Thanks,
    Ravi
Posted
Comments
Homero Rivera 27-Aug-14 22:58pm    
The code! The code!
Roliking 28-Aug-14 0:36am    
The HTML structure looks something like this. There are lot of javascript functions that are applied on it though and styles are being set from javascript files as well.

But the main concern here is the default highlight that comes on keyboard focus through tabbing is not getting set on the anchor tag within the li only in IE browser, even though i am trying to apply the outline explicitly it still doesn't show up. Any work around could be done for this?
Roliking 28-Aug-14 0:42am    
<ul id="colorDropDown" class="colorDropDownBox" style="height: 128px; overflow: hidden; padding: 0px; display: none; width: 351px;">
<div class="jspContainer" style="width: 351px; height: 128px;">
<div class="jspPane" style="padding: 0px; top: 0px; width: 351px;">
<li tabindex="0" class="colorDropDownRows">

<div>
<img alt="Naturally Pretty Eyeshadow Trio, Pretty in Amber" src="src1">
</div>
<div class="distinctionName">Pretty in Amber</div>

</li>
<li tabindex="0" class="colorDropDownRows">

<div>
<img alt="Naturally Pretty Eyeshadow Trio, Pretty in Nudes" src="src2">
</div>
<div class="distinctionName">Pretty in Nudes</div>

</li>
<li tabindex="0" class="colorDropDownRows">

<div>
<img alt="Naturally Pretty Eyeshadow Trio, Pretty in Plum" src="src3">
</div>
<div class="distinctionName">Pretty in Plum</div>

</li>
<li tabindex="0" class="colorDropDownRows">

<div>
<img alt="Naturally Pretty Eyeshadow Trio, Pretty in Smoke" src="src4">
</div>
<div class="distinctionName">Pretty in Smoke</div>

</li>
</div>
</div>
</ul>
Nathan Minier 28-Aug-14 8:38am    
It might be overwritten in an IE-specific style. Have you tried this in your css:

.colorDropDownRows : focus {
outline: 1px dotted black !important;
}

Also IE doesn't like rendering styles properly if you don't have a <!DOCTYPE> set which would be worth checking.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900