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)

2 Answers 2

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;
}
Sign up to request clarification or add additional context in comments.

3 Comments

@Brandon: what doesn't work? Rendering rounded corners? I know it doesn't.
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)
I understand your solution, but the answer is "not possible" to the question?
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)

2 Comments

Unless you plan on marking this as the accepted answer, this should be an edit to your original question, or at least a comment.
Ok, edited answer to close this thread. Will tick when stackoverflow allows me to.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.