1

I have a standardised rounded-corners button following the format like

<a href="#"><span>button name</span></a>

(Example:Anchor for left rounded corner, span for right rounded corner)

Problem is in IE, the context menu is that of the span tag and not the anchor, and hence I don't have the context menu option of opening up the parent link in new tab.

Is it possible to target the parent anchor and trigger it's context menu when I click on the span tag in IE?? I just want the browser default context menu, not a customised one.

(Works fine in FF)

bcm
  • 5,470
  • 10
  • 59
  • 92

2 Answers2

1

Get rid of the <span>, and use CSS to provide rounded corners on the anchor elements. This will make your HTML more semantic, and provide graceful degradation in browsers that don't support CSS rounded corners (read: IE).

HTML

<a href="#" class="rounded">button name</a>

CSS

a.rounded {
    border-radius: 2px;
    -moz-border-radius: 2px;
    -webkit-border-radius: 2px;
}
Community
  • 1
  • 1
Matt Ball
  • 354,903
  • 100
  • 647
  • 710
  • @Brandon: what doesn't work? Rendering rounded corners? I know it doesn't. – Matt Ball Jan 11 '11 at 03:24
  • Many ppl. still using IE7, I need to make sure it looks right as per design. (I'm not really for graceful degradation in this scenario) – bcm Jan 11 '11 at 03:25
  • I understand your solution, but the answer is "not possible" to the question? – bcm Jan 11 '11 at 03:28
1

I'll close this question with the answer: No known possible solution.

But here is the solution to the root of the question/issue: I'll try making the anchor the root element instead of the span.

That way, right click context menu will always have the option open in new tab for IE, whilst I can still keep the cross browser consistent (+dynamic width) rounded corners button. (Tried and tested)

bcm
  • 5,470
  • 10
  • 59
  • 92
  • Unless you plan on marking this as the accepted answer, this should be an edit to your original question, or at least a comment. – Matt Ball Jan 11 '11 at 04:36
  • Ok, edited answer to close this thread. Will tick when stackoverflow allows me to. – bcm Jan 11 '11 at 21:30