anchor

jQuery stopPropagation not working when applied to textbox inside anchor

安稳与你 提交于 2019-12-10 10:47:07
问题 hope you can help me. I have html markup like this: <a href="error.htm" class="button" id="_uiStart" style="-moz-border-radius: 4px 4px 4px 4px;"> <span>Start</span> <input type="text" id="_uiCode"> </a> Normaly, when user clicks on the textbox, the page redirects to "error.htm". I wanted to prevent that so I use jQuery to cancel that: $(document).ready(function() { var mute = function(event){ event.stopPropagation(); }; $('a.button input').click(mute) .mousedown(mute) .mouseup(mute); }

How to disable default <a> behaviour of “href” attribute?

丶灬走出姿态 提交于 2019-12-10 10:37:01
问题 I have a simple sidebar like this: <div class="sidebar"> <ul class="nav"> <li class="Page1"><a href="Page1.html">Page1</a></li> <li class="Page2"><a href="Page2.html">Page2</a></li> <li class="Page3"><a href="Page3.html">Page3</a></li> </ul> </div> This code exist on each one of the pages: page1.html, page2.html, page3.html. On Page1.html, I would like Page1 not to be clickable. On Page2.html, I would like Page2 not to be clickable. On Page3.html, I would like Page3 not to be clickable. Is

Strange results with an empty href and the :link pseudo class

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 02:02:04
问题 Here is some really simple markup and CSS: a { color: red; } a:link { color: green; } <a href="#">one</a> <a href="">two</a> <a href>three</a> <a>four</a> FIDDLE Now from the spec: in HTML4, the link pseudo-classes apply to A elements with an "href" attribute. So i'd expect the first 3 links to be green. But no, the result is actually that only the first link that has a non-empty href is green. So I used inspect element and I saw that the a:link selector actually overides the a selector in

Redirect to a new tab within javascript file

微笑、不失礼 提交于 2019-12-10 00:44:12
问题 I have code that sets: top.location.href = [someurl] But I want it to open up in a new tab. Is there anyway to have the above code include: target="_blank" ? 回答1: Use the method window.open(url, target) to open a new window (it depends on the browser or the user's settings whether the URL is opened in a new window or tab): window.open('http://stackoverflow.com', '_blank'); For more information about window.open() , read the documentation at w3schools. Please note: Randomly opening a new

a:visited doesn't work in Mozilla Firefox

扶醉桌前 提交于 2019-12-09 16:57:32
问题 I have created a link and when I try to set the style; a:visited { text-decoration: underline; color: #FF0000; } It doesnt seem to work. It works fine in IE. I have also followed the order; link, visited, hover, active. Is this a known issue, or am I making any mistake? 回答1: It might have to do with specificity and the order that you have your selectors in. In general, when specifying link states, you should follow the " l o v e/ ha te" principal: : l ink : v isited : h over : a ctive Maybe

Anchor not to top of page, but 200px down

柔情痞子 提交于 2019-12-09 11:20:41
问题 I have an anchor on a element which makes the navigation jump to that point. However the anchor snaps it right up to the top of the viewport. Due do a fixed navigation, it's now hidden behind. Is it possible to make the anchor not snap to the top of the viewport and instead 200px down the page? Site here: http://www.haselden.co.uk/james/docs 回答1: I was able to solve this by actually applying CSS to the anchor. So for the anchor I would have this... <a name="AnchorName" class="anchor"></a> And

Anchor around table - NOT working in outlook

牧云@^-^@ 提交于 2019-12-09 06:35:21
问题 I'm developing a newsletter for Mailchimp with below HTML structure for one of the block - <table border="0" cellpadding="0" cellspacing="0" width="100%" align="center"> <tr> <td valign="top" class="complete-block"> <a href="#" target="_blank"> <table border="0" cellpadding="9" width="100%" align="center" cellspacing="0" class="templateButton display-inline" mc:hideable> <tr> <td align="center" valign="middle" class="templateButtonContent"> Amazon </td> </tr> </table> </a> <a href="#" target=

jQuery mobile Tabs and Anchors

与世无争的帅哥 提交于 2019-12-09 03:54:23
问题 I would like create a tabbed mobile page using jQuery Mobile. I have got the basics of creating tabs (For Example Tab1, Tab2, Tab3, Tab4) and having each tab load a new page of content. How would I go about using an anchor within a specific tab? So for example if someone wanted to bookmark a link that took them right to Tab4 Anchor1. I am pretty new to JavaScript and jQuery. Code below: <!DOCTYPE HTML> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device

XHTML anchor link with background image and no text

最后都变了- 提交于 2019-12-08 19:53:19
问题 Is it possible to have anchor links no text inside that has a background image and fixed dimensions and still be good for SEO? Example CSS: a{display:block;width:50px;height:20px;background-image:url('images/background.jpg');background-repeat:no-repeat;background-position:0 0;} a:hover img{background-position:0 -20px;} Example HTML: <a href="#"></a> 回答1: If the image has text in it or you simply want to add its description, one thing you can do to help SEO and accessibility is to give the

How do I vertically align text inside an anchor element, which is nested within an unordered list

坚强是说给别人听的谎言 提交于 2019-12-08 18:03:26
问题 I have searched extensively and seen numerous examples on how to vertical-align text using the vertical-align property and the line-height property. However, all my efforts seem to bear no fruit as I am unable to get my text to align vertically. How do I do vertically align text to be centered? The height properties are not fixed so I can't use line-height . HTML <nav> <ul> <li><a href="html/login.html">Login</a></li> <li><a href="html/user_registration.html">Register</a></li> <li><a href="#"