У меня есть небольшая проблема с двумя div с использованием z-index
. Я создал div
под названием topbar с z-index: 1
, а другой называется "socialbuttons" с z-index: 2
который имеет ссылки на изображения в Facebook и Twitter. Тем не менее, верхняя панель перекрывает кнопки soc, и я не могу ни увидеть, ни щелкнуть социальные кнопки. Я просмотрел интернет и попробовал все, что мог, но я все еще придерживаюсь той же проблемы. Любая помощь будет принята с благодарностью. Вот мой код HTML
<div id ="topbar"
style="height: 56px; width:95%; background-color:#002268; z-index:-1; position:relative; top: -6px; left: -1px;">
</div>
<div id= "socialbuttons"
style= "position:relative; z-index: 1000; top: 15px; left: 770px; height:53px; width: 249px; margin-bottom: 0px;">
<a href="https://twitter.com" target="_blank">
<img alt="" src="images/twitter.png"
style="position:absolute; top: 0px; left:40%; height:49px; width: 59px; z-index:1000"/></a><a href="https://www.facebook.com" target="_blank"><img alt="" src="images/fbook.png"
style="position:relative; width:50px; height:49px; top: 0px; z-index:1000"/></a></div>
Я думаю, это то, что вы ищете
<div id ="topbar" style="height: 56px; width:95%; background-color:#002268; z-index:-1; position:relative; top: -6px; left: -1px;">
<a href="https://twitter.com" target="_blank">
<img alt="" src="https://cdn1.iconfinder.com/data/icons/yooicons_set01_socialbookmarks/48/social_twitter_box_white.png" style="float:right; height:49px; width: 59px;"/>
</a>
<a href="https://www.facebook.com" target="_blank">
<img alt="" src="https://cdn1.iconfinder.com/data/icons/yooicons_set01_socialbookmarks/48/social_facebook_box_white.png" style="width:50px; height:49px;float:right;"/>
</a>
</div>
Просто удалите позицию относительно социальных кнопок
<div id="socialbuttons" style="z-index: 1000; top: 15px; left: 770px; height:53px; width: 249px; margin-bottom: 0px;">