标签: href

带有href的HTML链接引用文本?

这是一个简单的是或否问题(可能没有),谷歌搜索似乎没有给我一个直接的答案.假设你有一个链接

<a href="www.stackoverflow.com">www.stackoverflow.com</a>
Run Code Online (Sandbox Code Playgroud)

有可能做出类似的东西

<a href=self.text>www.stackoverflow.com</a>
Run Code Online (Sandbox Code Playgroud)

没有使用任何其他东西(显然,没有脚本)?有什么样的捷径吗?

html href hyperlink

12
推荐指数
1
解决办法
4635
查看次数

使用用户ID链接Instagram个人资料

我想链接到Instagram上的个人资料/用户帐户.我有用户ID,但我在开发人员API文档中找不到答案.我已经尝试过instagram.com/ instagram.com/userID和instagram.com/users/,instagram.com/users/userID但这些都不起作用.简单的问题:我只有一个<a>标签,我想知道href将用户带到特定的Instagram个人资料中的内容.或者可能是window.locationjavascript.

或者,如果有办法从ID中获取用户名,我想我也可以通过这种方式来实现...

html javascript href instagram

12
推荐指数
1
解决办法
2万
查看次数

jquery动态更改svg image xlink:href

我试图用图像而不是填充颜色动态更改多边形的填充.为此,我找到了一种将填充更改为图像的方法,但我无法将xlink:href URL动态更改为随机URL.有什么想法吗?谢谢你的帮助!

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" width="320px" height="480px" viewBox="0 0 320 480" enable-background="new 0 0 320 480" xml:space="preserve" xmlns:xml="http://www.w3.org/XML/1998/namespace">
<pattern patternUnits="userSpaceOnUse" id="pat1" x="10" y="10" 
 width="425" height="319">
    <image id="background" width="100%" height="100%" 
     xlink:href="http://www.w3.org/1999/xlink" />
</pattern>
<g id="Layer_1">
    <polygon class="background"  fill="url(#pat1)" points="265.188,329.922 160.198,358 55.208,329.922 55.208,120.868 265.188,120.868  "/>

</g>
<g id="Layer_2">
    <g id="brand_mark_1_">
        <g>
            <rect x="265.188" y="120.868" fill="#FFFFFF" width="23.812" height="44.378"/>
            <g>
                <path fill="#020304" d="M275.372,149.035c0,0.949,0.77,1.72,1.721,1.72c0.949,0,1.72-0.771,1.72-1.72      c0-0.023-0.003-0.044-0.004-0.066v-16.261c0.004-0.043,0.007-0.088,0.007-0.134c0-0.95-0.77-1.72-1.719-1.72      c-0.942,0-1.707,0.757-1.72,1.695h-0.005v16.461h0.001C275.374,149.017,275.372,149.025,275.372,149.035z"/>
                <circle fill="#F5170D" cx="277.093" cy="153.541" r="1.72"/>
            </g>
        </g>
    </g>
</g>
</svg>


 $(document).ready(function() {
                var randomColor = Math.floor(Math.random()*16777215).toString(16), …
Run Code Online (Sandbox Code Playgroud)

jquery svg href

12
推荐指数
3
解决办法
2万
查看次数

HTML:删除a:悬停图片?

对于文本链接,我有:

CSS:

a:link {color: #3366a9; text-decoration: none}
a:hover {border-bottom: 1px solid; color: black}
Run Code Online (Sandbox Code Playgroud)

但这也增加了我不想要的可链接IMG的黑色下划线.

如何border-bottom使用CSS悬停时删除可链接的IMG?

我尝试过以下方法:

a:hover img {border-bottom: 0px}
Run Code Online (Sandbox Code Playgroud)

但这不起作用

实例 (尝试将鼠标悬停在左上角的徽标上)

html css image href css-selectors

11
推荐指数
2
解决办法
3万
查看次数

href ="#"重定向到索引页面,但不重定向到当前页面的顶部

在网站上有一个奇怪的问题.链接标记href="#anything"不会将您移动到页面顶部或指定的锚点,它会将您移动到主页.就是这样 - 当我将鼠标悬停在链接上时,我会在FF的状态栏中看到example.com/#而不是example.com/testpage.php#.

网站上堆满了垃圾代码,无法验证所有设置,特别是标头配置等.

关于这可能是什么的任何提示?

PS Link href没有改变JS,Firebug声称它是href="#"我点击它的时候.

html anchor href

11
推荐指数
1
解决办法
1万
查看次数

href ="",href ="#"和href ="javascript:void(0)"之间有什么区别?

有什么区别href="",href="#"href="javascript:void(0)"
它们有什么不同的用途,什么时候比另一个更好?

html href

11
推荐指数
2
解决办法
1万
查看次数

如何为锚标签添加特定值?

我有以下代码

<a href="" (set value 1)>Inside Link which sets a value</a>

<script>
$(a).click(function() {
    i=value of a tag;
    $('#square').animate({'left': i * 360});
});

</script>
Run Code Online (Sandbox Code Playgroud)

我想为锚标签添加一个值属性.怎么做?

tags jquery href jquery-animate

11
推荐指数
2
解决办法
4万
查看次数

AngularJS + Base Href区分大小写?

我很难理解为什么我的基础href似乎区分大小写.我有一个带有基本href的页面,并使用angularjs路由.

HTML:

<html ng-app="app">
    <head>
        <base href="/Foo/"/>
    </head>
    <body>
        <div>Foo</div>
        <div ng-view></div>  
    </body>
</html>
Run Code Online (Sandbox Code Playgroud)

JS:

var module = angular.module('app', []);

module.config(function ($routeProvider, $locationProvider) {
    $routeProvider
        .when('/Home/Page1', { templateUrl = 'partials/page1' })
        .otherwise({ redirectTo: '' });

     $locationProvider.html5Mode(true);
     $locationProvider.hashPrefix('!');
});
Run Code Online (Sandbox Code Playgroud)

如果我导航到http://www.example.com/Foo/,那很好.但是当我导航到http://www.example.com/foo/时,我收到一个角度误差:

Error: Invalid url "http://www.example.com/foo/", missing path prefix "/Foo" !
at Error (<anonymous>)
at Object.LocationUrl.$$parse (http://www.example.com/foo/Scripts/angular.js:4983:13)
at Object.LocationUrl (http://www.example.com/foo/Scripts/angular.js:5014:8)
at $LocationProvider.$get (http://www.example.com/foo/Scripts/angular.js:5387:21)
at Object.invoke (http://www.example.com/foo/Scripts/angular.js:2809:28)
at http://www.example.com/foo/Scripts/angular.js:2647:37
at getService (http://www.example.com/foo/Scripts/angular.js:2769:39)
at Object.invoke (http://www.example.com/foo/Scripts/angular.js:2787:13)
at $CompileProvider.directive (http://www.example.com/foo/Scripts/angular.js:3613:43)
at Array.forEach …
Run Code Online (Sandbox Code Playgroud)

routing base href angularjs

11
推荐指数
3
解决办法
7663
查看次数

从<a>标签获取href值

我有以下html:

<div class="threeimages" id="txtCss">  
<a>   
       <img alt="Australia" src="/Images/Services%20button_tcm7-9688.gif"/>
</a>        
    <div class="text" id="txtLink">            
        <h2>
            <a href="/partnerzone/downloadarea/school-information/australia/index.aspx">Australia</a>
        </h2>            
        <p>Land of the sunshine!</p>        
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

现在,如果你看到div ID"txtLink"中有href,即澳大利亚

我想在页面的运行时将相同的href值复制到div ID"txtCss"的上面标签中,我的意思是当我的页面显示时我的html将如下所示:

<div class="threeimages" id="txtCss">  
<a href="/partnerzone/downloadarea/school-information/australia/index.aspx">   
       <img alt="Australia" src="/Images/Services%20button_tcm7-9688.gif"/>
</a>        
    <div class="text" id="txtLink">            
        <h2>
            <a href="/partnerzone/downloadarea/school-information/australia/index.aspx">Australia</a>
        </h2>            
        <p>Land of the sunshine!</p>        
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

请为上述问题提出一些代码

html javascript href

10
推荐指数
2
解决办法
10万
查看次数

如何写入'mailto'正文链接到当前页面

我的mailto网站的所有页面都有按钮,我想在电子邮件正文中写入该页面的引用.

在一个页面我可以

<a class="email" title="Email a friend" href="mailto:?subject=Interesting%20information&amp;body=I thought you might find this information interesting:%20%0d%0ahttp://www.a.com/Home/SiteMap/tabid/589/Default.aspx">Email</a>
Run Code Online (Sandbox Code Playgroud)

但是,我怎样才能为所有页面制作这个通用名称?

html javascript href

10
推荐指数
2
解决办法
7万
查看次数