23

The ASP.NET menu creates a skiplink which has 0x19 size and it is invisible in Explorer, but it is rendered in Chrome! So my menu has an extra 19 pixels indent! How do I overcome this? Here is its HTML:

<a href="#HeaderMenu1_Menu1_SkipLink">
<img alt="Skip Navigation Links" src="/WebResource.axd?d=ChOum_wTGSzbwK97BQPV0ITybaR8NYj0fCEsJDNZ46Dhv_eO5a-qipjyNL4I6aiynUitzcOuIwIjwyFX_snxVbyAZO7glY1Vhbd4zETG4j41&amp;t=634280594527374621" width="0" height="0" style="border-width:0px;">
</a>

3 Answers 3

55

Add SkipLinkText="" to <asp:Menu> tag and this code won't be rendered.

1
  • 1
    Thanks A million. I was Scratching my head for two days and couldn't figure this out. Commented May 8, 2014 at 18:55
4

I haven't used the built in Menu control so did some digging and found that the default asp.net template it wraps the asp:Menu control in a div with the following styles:

<div class="clear hideSkiplink">
    <asp:Menu...

The styles are defined as:

.clear
{
    clear: both;
}

div.hideSkiplink
{
    background-color:#3a4f63;
    width:100%;
}
1
  • Yes, it works. It even works if .hideSkiplink class is empty.
    – whyleee
    Commented May 2, 2011 at 18:43
0

You can also set SkipLink = String.Empty

Not the answer you're looking for? Browse other questions tagged or ask your own question.