Css:当我单击一个元素时,单击了两个

时间:2018-08-17 08:07:10

标签: javascript css3 onclick

我有一个属性,它的宽度和我的图标在属性的后面 我想单击图标,但是单击了图标,然后单击了两个

我能得到什么:

enter image description here

<div class="mob-menu-logo-holder">
 <a href="http://localhost/site1" class="headertext">
 <img class="mob-standard-logo" src="http://localhost/site1/wp-content/uploads/2018/08/logo_by_me-1.png" alt=" Logo Header Menu">
 <img class="icon_search" src="http://localhost/site1/wp-content/uploads/2018/08/icon_search.png">
  </a>
</div>

2 个答案:

答案 0 :(得分:1)

请为您要单击的图像提供z-index,以解决您的问题

答案 1 :(得分:0)

两者都在同一<a> .. </a>元素内。如果您想将它们分开,请使用其中几个分开:

<div class="mob-menu-logo-holder">
 <a href="http://localhost/commentairecompose" class="headertext">
 <img class="mob-standard-logo" src="http://localhost/site1/wp-content/uploads/2018/08/logo_by_me-1.png" alt=" Logo Header Menu">
</a>
 <a href="http://localhost/perhapsdifferentURI" class="headertext">
 <img class="icon_search" src="http://localhost/commentairecompose/wp-content/uploads/2018/08/icon_search.png">
  </a>
</div>