在我的网站的标题上http://thetrashedvintage.com/我使用:
<div class="collections" onclick="location.href='http://thetrashedvintage.com/wool-collection';" style="cursor: pointer;">
<img src="http://www.thetrashedvintage.com/collections.jpg" alt="Collections" />
</div>
使div可点击,但当我点击它时,它会重定向到其他地方,当我点击Collections时,它将我重定向到Login,下一个div,你知道我做错了什么吗?
谢谢你的帮助!
您的Collectionsdiv与您的Logindiv 重叠
为了解决这个问题,
从更改CSS
div.login {
width: 50%;
right: -130px;
}
至
div.login {
/*width: 50%; <-- REMOVE THIS */
right: 115px;
}
试着把你的div放在这样的中
<a href="location where your stuff is"><div class="collections" style="cursor: pointer;"> <img src="http://www.thetrashedvintage.com/collections.jpg" alt="Collections" />
</div></a>
您有错误的CSS。如果您让FireFox使用Inspector,请按Ctrl+Shift+C并在登录时用鼠标转到,然后查看margins-div登录(重叠集合),然后转到左边的margins-collection。固定位置的CSS是个坏主意。
对不起,我的英语很有趣。