Menu Control - 1 px line rendered on top of menu because of SkipLink

Last post 01-13-2009 10:11 AM by Careed. 1 replies.

Sort Posts:

  • Menu Control - 1 px line rendered on top of menu because of SkipLink

    01-13-2009, 9:34 AM
    • Member
      6 point Member
    • FrodeD
    • Member since 05-23-2007, 8:16 AM
    • Posts 16

    Hi,

    Maybe someone else have noticed this: The Menu control render a SkipLink above the normal table. It is meant to be invisible to normal browsing, but is useful for screen readers.

    From what I find in documentation the SkipLink is not meant to be rendered as default, but it is definitely rendered! Here is what is rendered for my menu, using VS2008SP1, WinXP SP3, Norwegian language pack and keyboard settings:

    <a href="http://forums.asp.net/AddPost.aspx?ForumID=139#ctl00_Menu1_SkipLink"><img alt="Hopp over navigasjonskoblinger" src="/Website1/WebResource.axd?d=WZICFUiVXgQuv4Oy9kwWDg2&amp;t=633638189441914789" width="0" height="0" style="border-width:0px;" /></a>

    While width and height and border of this image is all set to 0 it is still rendered by IE7 (and other browsers?) as 1 px point, and will cause a 1px line to be visible on top of you table... This is most annoying in a menu layout, for example when putting the menu inside a div container and setting color and size on the div container.

    The documentation claims that this link should not be rendered by default:

    http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.menu.skiplinktext(VS.85).aspx

    SkipLinkText: The alternate text of a hidden image read by screen readers to provide the ability to skip the list of links. The default is an empty string (""), which indicates that this property is not set.

    Some more info can be found here, but to my experience this issue with SkipLink happens also without the display:block setting on a tags ...
    http://www.codeverge.net/ng.asp-net-forum.master_pages_themes_and_navigation_controls/.menu-and-the-skip-link

    The only workaround I've found is to set SkipLinkText="" in menu definition, which stops the SkipLink to be rendered.

    Any other workarounds here? Is this only an issue for non-English users?

    Best Regards

    Frode D

  • Re: Menu Control - 1 px line rendered on top of menu because of SkipLink

    01-13-2009, 10:11 AM
    Answer
    • Star
      7,686 point Star
    • Careed
    • Member since 06-24-2002, 3:37 AM
    • Lubbock, TX
    • Posts 1,499

    You are not alone.  If not included, a tag for the skip link is added before the menu table in the rendered HTML.  As for the 1 px line, this is a result of your stylesheet, not the tag itself.  So, if you have a style for your anchor tags (a), then you might want to consider using a CssClass attribute for your menu control.  I tried this and it does not include the skip link with the menu items' style.

    Christopher Reed
    "The oxen are slow, but the earth is patient."
Page 1 of 1 (2 items)