In Visual Studio 2010 when creating a new ASP.NET Web Site or ASP.NET Web Application you get a shell for ASP.NET 4.0 web site with a menu using the ASP.NET 4.0 Menu Control. However in Google Chrome and Safari browsers the menu will show with some extra space above it. It took plenty of googling to find the answer since google is filled with solutions for Chrome problems in ASP.NET 2.0.
Finally – the solution for .NET Framework 4.0:
Add these lines to the Site.css file (in the Styles folder of your VS 2010 project)
[code lang=”css”]
/* Fix for extra space above menu in Chrome and Safari */
img[alt=’Skip Navigation Links’] {
display: none;
}
[/code]
An alternative is to add SkipLinkText=”” to each menu item (have not tested this)
Thanks to MattyF for the solution
Finally, something that works! Thanks!
Thanks a lot, it works.
The fix by setting SkipLinkText=”” does not need a property for each menu item, just the menu control itself.
See http://jepsonsblog.blogspot.com/2010/12/asp-menu-leaving-empty-space-above-menu.html for an explanation.
Finally thank you very much!!!!
Thanks for the simple solution! Worked great!
Brilliant, saved me a lot of time…..thank you
Do no use this. This image is used by screen readers. It is an accesibilty feature. display:none also hides it from screen readers. Use this instead:
img[alt=’Skip Navigation Links’] {
position:absolute;
left:-10000px;
top:auto;
width:1px;
height:1px;
overflow:hidden;}
You saved my life
2011 … and now 2013
you are best
Great! It works.. thank you very much.
/* Fix for extra space above menu in Chrome and Safari */
img[alt=’Skip Navigation Links’] {
display: none;
}
This is good solution but it will create problem in Mozilla Firefox. In Firefox it will add some space in header
Yes I also having problem in Firefox while applying above solution.
The above solution
img[alt=’Skip Navigation Links’] {
display: none;
}
is working fine but after applying this it is creating problem in Mozilla Firefox.
Can you please advice for this?
it is working fine but after applying this it is creating problem in Mozilla Firefox.
Thank you for sharing your brilliant helpful experience and saving lot of time. good job
Thank you!
Great, finally this is resolved my issue! Thank you.