anchor

Share anchor links

强颜欢笑 提交于 2019-12-01 07:12:08
问题 I want to make a button that shares links in this form: http://example.com/#anchor but when i click it, it shares only http://example.com How could I make it share what I want? 回答1: Your question is not very detailed and it's not easy to understand exactly what it is you're asking for.. Since the share functionaliy was deprecated I assume that you are talking about the Like button. As you can see in that page you can put what ever url you want into the "URL to Like" field, then click the "Get

General offset for all anchors in HTML?

不羁的心 提交于 2019-12-01 05:39:00
I have some anchor elements, but they are in absolute position div and the content of the div is so large that it scrolls inside (overflow:auto). All entries in the div have an anchor on top, but if I go to this anchor I have the element I wanted to directly on top of the side, but I want it in the center. I need something like an offset so I can jump higher than normal. you could always add another div to wrap around it, and then do something like .wrapperdiv{ position:relative; top:-10px; } You could try a Javascript scroll to correct the position. 来源: https://stackoverflow.com/questions

Delphi XE2: Jumping to an anchor in CHM?

放肆的年华 提交于 2019-12-01 05:22:43
In a Delphi XE2 program, how do I jump to an anchor inside a CHM help file topic? The anchor has the following format (extracted from the source of the topic page in HTML HelpViewer showing the CHM file): <a name="my_anchor_id"></a> I tried the following: Application.HelpJump('MyTopicName.htm#my_anchor_id'); Unfortunately, this does not work: It does jump to this topic, but only to the top of the topic, not to the anchor, which is several scrolls down the page. Jumping to an anchor in CHM Tested with Delphi2010 - DelphiXE2 - Windows XP How to jump to an anchor in a chm file (Compiled HTML Help

Empty-linked anchor

廉价感情. 提交于 2019-12-01 05:14:07
I have an anchor that doesn't go anywhere but has an onclick (e.g. <a onclick="..."></a> ). My question pertains to the href attribute. What should I put for the value? If I simply omit href , the anchor doesn't have the appropriate decoration--the mouse pointer icon doesn't change when the mouse is put over it. If I use href="#" , then the window scrolls to the top of the page when the link is clicked. If I use href="javascript:..." and put the value of onclick proceeding javascript: , the page is left and the address bar contains the Javascript when the link is clicked. When I refer to

Is a link without the protocol valid XHTML? i.e. <a href=“//www.example.com/”>

陌路散爱 提交于 2019-12-01 04:50:37
Is it valid XHTML / good practice to have links of the following form? //www.example.com/foo/bar.html If the current page is HTTP, then the link points to: http://www.example.com/foo/bar.html If the current page is secured under HTTPS, then the link points to: https://www.example.com/foo/bar.html In other words, is <a href="//www.example.com/"> valid in XHTML 1.1 Strict ? And, is it supported by many/all browsers? Is it valid XHTML Completely. XHTML doesn't care about the syntax of URIs. The href attribute is defined as containing CDATA. valid in XHTML 1.1 Strict? There is no such language.

ASP.NET add a httphandler to edit downloaded file name

梦想与她 提交于 2019-12-01 04:30:43
I have in my project a page DownloadDocument.aspx and it's codebhind is DownloadDocument.aspx.cs In my DownloadDocument.aspx i have an anchor which take a dynamic link like this: <a id="downloadLink" runat="server" style="margin:5px" href="<%# CONTENT_DIRECTORY_ROOT + document.Path %>">Download current file</a> I want to add a httphandler to control the file name downloaded, How can i do it? Thanks in advance. How about using a generic handler (.ashx) for this? You need to add loading specific information, like filename, contenttyp and the content itself. The sample should give you a good

Proper way for links to execute javascript code

假如想象 提交于 2019-12-01 04:27:14
So there are 4 main methods I'm aware of to execute javascript code from a link. For my requirements, I need to do so without moving the screen anywhere (linking to # and not returning false is bad). SEO for the executed javascript code, if possible, is important too. So what's the right way to do this? method 1 (need to make sure myCode() returns false always): <a href="#" onclick="return myCode();">execute</a> method 2 (seems to make the most sense?): <a href="javascript:myCode();">execute</a> method 3: <a href="javascript:void(0);" onclick="myCode();">execute</a> method 4 (not as pleasant

How to normalize a button and an anchor with CSS?

允我心安 提交于 2019-12-01 03:57:30
Check out this code sample of a button and an anchor: http://jsbin.com/ecitex/2/edit I'm trying to make them identical in all browsers. But differences remain, and different differences in every browser (tried Chrome, Safari, Firefox, IE8). Which CSS normalizations am I missing? Update: Per suggested: I added line-height: 50px (although my user agent's (Chrome's) default line-height for button elements is normal , and still it vertically centers text – how?!) I added cursor: pointer to normalize mouse cursors. http://jsbin.com/ecitex/11/edit So, now check out the result in Firefox: notice the

Navigate to anchor on another page

ぃ、小莉子 提交于 2019-12-01 03:44:37
I simply want to navigate from one page to a specific point on another I have a home page with four sections. <section> <a name="section1"></a> </section> <section id="section2"> </section> <section> <a name="section3"></a> </section> <section id="section4"> </section> Section 2 and 4 feature on every page, so my nav looks like: <nav> <ul> <li><a href="index.html#section1">ABOUT</a></li> <li><a href="#section2">APARTMENTS</a></li> <li><a href="index.html#section3">LANDLORDS</a></li> <li><a href="#section4">CONTACT</a></li> </ul> </nav> The links aren't navigating to the index page or the

href=“#” redirects to the index page but not to the current page's top

有些话、适合烂在心里 提交于 2019-12-01 03:32:52
Having an odd problem at the site. Link tag having href="#anything" doesn't move you to the top of the page or to the specified anchor, it moves you to the home page. That's it - when I hover over the link I see at my FF's status bar example.com/# instead of example.com/testpage.php# . Site is full of crap code and it's impossible to verify all of the settings and especially header configuration or etc. Any hints on where this might be? P.S. Link's href is not altered with JS, Firebug claims it to be href="#" when I click it. My initial thought is that you may have a base tag in play somewhere