【发布时间】:2017-11-21 20:38:43
【问题描述】:
到目前为止,这是我的代码。我希望我的页面具有背景全屏图像,如果我单击图像,它将在新选项卡中打开一个链接。
这是我的 CSS
html,
body {
/*css for full size background image*/
background: url(../images/bg.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
这是我的html
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet"href
="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css">
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.0/jquery.min.js">
</script>
<script
src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js">
</script>
</head>
<body>
</body>
</html>
【问题讨论】:
-
您是否研究过 JQuery 和
on('click')事件? -
请说明您尝试过的方法不起作用。 Stackoverflow 不是“如何” 教程服务。目的是让您研究如何并显示未按预期工作的代码
-
我不知道 jquery 或 javascript。虽然图像现在没有响应。检查此链接。 mapdc.org
标签: javascript jquery html css twitter-bootstrap-3