[英]how do i add a link to a background image on html body tag
在此頁面上,我在<body>
標記上具有背景圖像,並且我想知道是否可以向其添加鏈接,以便單擊該鏈接。
如果這不可能,我將如何添加將被超鏈接的包裝器<div>
?
<body id="index">
</body>
body#index {
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-image: url(//) !important;
background-size: cover;
background-repeat: no-repeat;
background-color: transparent !important;
background-position: center;
width: 100%;
height: 100%;
檢查這是否是你想要的
<body id="index">
</body>
的CSS
body#index {
background-color: red !important;
width:100vw;
height: 100vh;
}
jQuery的
$('body').click(function () {
location.href="http://www.google.com";
})
嘗試這個
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.