链接 href 仅适用于 Chrome
我正在制作一个打开链接(网站)的按钮,但问题是它只适用于 chrome!为什么?? 链接在这里!
这里是简单的 html 代码>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>HTML and CSS Rounded Corner Button Generated By iWebToolsOnline.com</title>
<link href="./style.css" rel="stylesheet" type="text/css" />
<style href>a {text-decoration: none} </style>
</head>
<body>
<h3> </h3>
<button class="rounded">
<a href="http://www.iwebtoolsonline.com/rss-feed-icon-generator">
<span>Save</span>
</a>
</button>
<br/><br/>
</body>
</html>
CSS
button {
border: 0 none;
cursor: pointer;
font-weight: bold;
padding: 0 15px 0 0;
text-align: center;
height: 40px;
line-height: 40px;
width: auto;
}
button.rounded {
background: transparent url( btn_right.png ) no-repeat scroll right top;
clear: left;
font-family: "Kristen ITC";
font-size: 36px;
}
button span {
display: block;
padding: 0 0 0 15px;
position: relative;
white-space: nowrap;
height: 40px;
line-height: 40px;
}
button.rounded span {
background: transparent url( btn_left.png ) no-repeat scroll left top;
color: #FFFFFF;
}
button.rounded:hover {
background-position: 100% -40px;
}
button.rounded:hover span {
background-position: 0% -40px;
}
button::-moz-focus-inner {
border: none;
}
您可以在我尝试访问的链接中找到我用于按钮的生成器中的链接,生成器没有提供链接的代码,所以我只是在按钮中使用了 href,我这没有正确完成吗? 还有什么问题?
多谢!
Im making a button that opens a link (web site), but the problem is that it only works on chrome!! why??
link here!
here the simple html code>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>HTML and CSS Rounded Corner Button Generated By iWebToolsOnline.com</title>
<link href="./style.css" rel="stylesheet" type="text/css" />
<style href>a {text-decoration: none} </style>
</head>
<body>
<h3> </h3>
<button class="rounded">
<a href="http://www.iwebtoolsonline.com/rss-feed-icon-generator">
<span>Save</span>
</a>
</button>
<br/><br/>
</body>
</html>
CSS
button {
border: 0 none;
cursor: pointer;
font-weight: bold;
padding: 0 15px 0 0;
text-align: center;
height: 40px;
line-height: 40px;
width: auto;
}
button.rounded {
background: transparent url( btn_right.png ) no-repeat scroll right top;
clear: left;
font-family: "Kristen ITC";
font-size: 36px;
}
button span {
display: block;
padding: 0 0 0 15px;
position: relative;
white-space: nowrap;
height: 40px;
line-height: 40px;
}
button.rounded span {
background: transparent url( btn_left.png ) no-repeat scroll left top;
color: #FFFFFF;
}
button.rounded:hover {
background-position: 100% -40px;
}
button.rounded:hover span {
background-position: 0% -40px;
}
button::-moz-focus-inner {
border: none;
}
You can find the link from the generator I used for the button in the link Im trying to go to, the generator doesn't give the code for the link so I just used href in the button, I this not done properly??
what else could be the problem?
Thanks a lot!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这样做:
但这在 IE6 或 7 中不起作用(你需要用 JS(JQuery 示例)来模拟它):
但在 Firefox 中它仍然会调用该页面两次(也许这对你来说并不重要)。有关于此的错误报告(https://bugzilla.mozilla.org/show_bug.cgi?id=577035)。
请记住,将“BUTTON”放在“A”内是违反 W3C 标准建议的。
Do it like this:
But this wont work in IE6 or 7 (you will need to emulate it with JS (JQuery example)) :
But still in Firefox it will call twice that page (maybe it won't matter you). There is bug report about that (https://bugzilla.mozilla.org/show_bug.cgi?id=577035).
Just remember that having "BUTTON" inside "A" is against W3C standard recommendations.