开发者

Right click in Firefox selects/highlights html elements...why?

I have built a custom context menu but have found annoyingly that when I right click on my site in firefox text and images just seem to randomly get selected.

The link below is a basic html dump of the page that is having issues. You can see that when you right click it in Firefox, certain elements are highlighted. Very annoying!开发者_JS百科 This must be a purely html markup problem in Firefox as there is absolutely no CSS or JS on this page.

Example Here: http://pastehtml.com/view/1e16jup.html

Love to hear your thoughts/suggestions...


There are a lot of errors in this page have a look at the validator result here.

Maybe it gives firefox a lot of problem rendering the page properly.

Close all the <meta> and <img> tags, <script> must have proper type attributes, tags like <h1> shouldn't be placed inside of <a>, <p> neither.


I'm assuming you mean the HTML5 contextMenu? Because this is not implented in any browser.


A bit of quick investigation seems to demonstrate that the header+footer elements have this behaviour. Also, lists appear to have it as well. This is because those elements have a certain semantic use and this behaviour seems consistent with those semantic uses. Check out the specification to see how these elements are intended to be used.

I'm firing blind but I'd suspect you can override this with -moz-user-select - but this is going contrary to the Firefox user experience. I wouldn't recommend it at all.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜