我已经制作了一个粘性的栏来联系我.[图1] Image 1

区块的代码:

[tag:
<!-- Social Sharing Bar -->
<div class="fixed right-0 bg-[#ffc113] top-40 z-50 px-5 py-3 flex flex-col space-y-3 w-16 border-solid border-2 border-neutral-900">
    <!-- Call -->
    <a href="#" class="" title="Call Us">
        <svg fill="" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
            <path stroke-linecap="round" stroke-linejoin="round" d="..."></path>
        </svg>
    </a>
    </div>
    <div class="fixed right-0 bg-[#ffc113] top-52 z-50 -my-1 px-5 py-3 flex flex-col space-y-3 w-16 h-40 border-solid border-2 border-neutral-900">
    <!-- Users -->
    <a href="#enquire" class="h-16 -rotate-90 whitespace-nowrap h-24 my-7" title="Share on Twitter">
        <p class="h-24 py-10 whitespace-nowrap">
            Enquire Now
        </p>
    </a>
</div>
    <div class="fixed right-0 bg-[#ffc113] top-80 z-50 px-5 py-3 flex flex-col space-y-3 w-16 border-solid border-2 border-neutral-900 socialbutton">
    <!-- Users -->
    <a href="#" title="Share on Twitter">
        <svg fill="" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
            <path stroke-linecap="round" stroke-linejoin="round" d="..."></path>
          </svg>
</a>
</div>
<div class="socialhide">
    <!-- <div class="flex justify-center">
        <button type="button" data-mdb-ripple="true" data-mdb-ripple-color="light" class="inline-block px-6 py-2.5 mb-2 text-white font-medium text-xs leading-tight uppercase rounded shadow-md hover:shadow-lg focus:shadow-lg focus:outline-none focus:ring-0 active:shadow-lg transition duration-150 ease-in-out" style="background-color: #1877f2;">
          <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" class="w-4 h-4">
            <path fill="currentColor" d="..."/>
          </svg>
        </button>
      </div> -->
      <div class="flex justify-center space-x-2">

        <a href="#!" role="button">
          <!-- Facebook -->
          <svg xmlns="..." class="w-7 h-7" style="color: #1877f2;">
<path fill="currentColor" d="..."/></svg>
        </a>
      
        <a href="#!" role="button">
          <!-- Instagram -->
          <svg xmlns="..."/></svg>
        </a>
      
        <a href="#!" role="button">
          <!-- Google -->
          <svg xmlns="..."/></svg>
        </a>
      
        <a href="#!" role="button">
          <!-- Twitter -->
          <svg xmlns="..."/></svg>
        </a>
      
      </div>
</div>
<!-- Content -->]

因此,当我将鼠标悬停在社交按钮上时,它应该会显示在屏幕上:(图2) Image 2

但当我 Select 任何一种社交媒体时,它就会消失.

Css代码:

.socialhide {
  display: none;
}

.socialbutton:hover + .socialhide {
  display: flex;
  height: 48px;
  align-items: center;
  text-align: center;
  justify-content: center;
  /* color: red; */
  position: fixed;
  background: #ffc113;
  right: 65px;
  top: 39%;
  flex-direction: column;
  z-index: 999;
  border: 2px solid black;
}

谢谢,请帮帮我.

我需要和它在网上一样的社交wine 吧 https://www.brigadegroup.com/

推荐答案

正如我所看到的,你只有.socialbutton元素的hover状态,所以当你将鼠标悬停在.socialhide上时,display: none;就适用.您还需要为.socialhide div添加悬停状态,如下所示:

.socialhide {
  display: none;
}

.socialhide:hover,
.socialbutton:hover + .socialhide {
  display: flex;
  height: 48px;
  align-items: center;
  text-align: center;
  justify-content: center;
  /* color: red; */
  position: fixed;
  background: #ffc113;
  right: 65px;
  top: 39%;
  flex-direction: column;
  z-index: 999;
  border: 2px solid black;
}

Html相关问答推荐

简化指标与Delta保持一致

从网络抓取中提取文本

如何打破长URL,包含连字符在HTML与CSS

如何格式化HTML文本,使其环绕关键字

如何使div按钮链接到另一个网页

如何在一行文本溢出省略号后显示文本?

响应CSS中的两到三列布局

禁用的文本区域会丢失换行符

文本css后面未显示背景 colored颜色

布局更改时的转换

来自元标记的响应文本

并排放置两个 div,同时 div2 环绕 div1

如何围绕中心zoom svg 并使父级达到其子级大小的 100%

如何调整底部有 SVG 的元素的高度,使其在所有宽度上看起来都不错?

不完整的悬停

更改标签标签的大小

导航丸被选中(活动),但内容未显示.怎么会?

如何将某些 div 的高度限制为具有 display flex 行的同一父 div 中的其他 div?

如何在react 中向按钮添加禁用属性?

有没有办法在 CSS 类子句中指定多个 HTML 元素?