簡體   English   中英

href位置無效

[英]href location doesn't work

在我的網站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可點擊,但是當我單擊它時,它會重定向到其他地方,當我單擊“收藏夾”時,它會將我重定向到下一個div的“登錄名”,關於我做錯了什么的想法?

謝謝你的幫助!

嘗試將您的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>

您的收藏div被登錄div覆蓋了

要解決此問題,

從更改您的CSS

div.login {
  width: 50%;
  right: -130px;
}

div.login {
  /*width: 50%; <-- REMOVE THIS */
  right: 115px;
}

您的CSS錯誤。 如果您使用FireFox使用Inspector,請在登錄時按Ctrl + Shift + C並用鼠標轉到,然后查看margin div登錄(重疊集合),再轉到左邊有利潤集合。 固定位置的CSS是個壞主意。

對不起,我有趣的英語。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM