css给按钮加上超链接的方法:1、使用“window.location.href('url地址')”方法让本页转向新的页面;2、使用“window.open('url')”方法打开一个新的页面。

本教程操作环境:windows7系统、HTML5&&CSS3版本,Dell G3电脑。 相关推荐:《css视频教程》 html/css给按钮加上超链接 可以使用HTML onclick 事件属性 1、如果让本页转向新的页面则用: <input type="button" onclick="window.location.href('url地址')"><button onclick="javascript:window.location.href='url地址';">这是一个按钮</button> 2、如果需要打开一个新的页面进行转向,则用: <input type="button" onclick="window.open('url')">3、如果需要返回到上次打开的页面,则用: <input type="button" onclick="window.history.back()"> 以上就是css怎么给按钮加上超链接的详细内容,更多请关注模板之家(www.mb5.com.cn)其它相关文章! |