下划线悬停提示框效果

代码语言:html

所属分类:悬停

代码描述:下划线悬停提示框效果

代码标签: 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">

<style>

body {
  -webkit-box-align: center;
          align-items: center;
  display: -webkit-box;
  display: flex;
  font-family: "Josefin Sans", sans-serif;
  font-size: 40px;
  -webkit-box-pack: center;
          justify-content: center;
  line-height: 1.3em;
  height: 100vh;
}
.container {
  -webkit-box-align: center;
          align-items: center;
  background-color: #f2f2f2;
  box-sizing: border-box;
  display: -webkit-box;
  display: flex;
  flex-shrink: 0;
  height: 500px;
  -webkit-box-pack: center;
          justify-content: center;
  width: 500px;
  padding: 20px;
  position: relative;
}
.text {
  width: 395px;
}
.word {
  cursor: pointer;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.link {
  font-size: 18px;
  left: 20px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: -68px;
  -webkit-transform: translateY(84px) scale(0.5);
          transform: translateY(84px) scale(0.5);
  -webkit-transform-origin: 0% 50%;
          transform-origin: 0% 50%;
  -webkit-transition: opacity 300ms cubic-bezier(0.4, 0, 0.2, 1),
    -webkit-transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
  transition: opacity 300ms cubic-bezier(0.4, 0, 0.2, 1),
    -webkit-transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
  transition: opacity 300ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
  transition: opacity 300ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 300ms cubic-bezier(0.4, 0, 0.2, 1),
    -webkit-transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  z-index: 1;
}
.link.active {
  opacity: 1;
  -webkit-transform: translateY(0) scale(1);
          transform: translateY(0) scale(1);
  /* transition: opacity 200ms 100ms, transform 200ms 100ms; */
}
.underline {
  background-color: #e28090;
  -webkit-clip-path: polygon(
    10.41708% 53.4%,
    50.42189% 53.40079%,
    50.423% 53.44997%,
    50.42189% 53.49995%,
    50.423% 53.54992%,
    50.42189% 53.5999%,
    50.423% 53.64987%,
    50.42189% 53.69985%,
    50.423% 53.74982%,
    50.42189% 53.79979%,
    50.423% 53.84979%,
    50.42189% 53.89979%,
    50.423% 53.94979%,
    50.42189% 53.99979%,
    50.423% 54.04979%,
    50.42189% 54.09979%,
    50.423% 54.14979%,
    50.42189% 54.19979%,
    50.423% 54.24979%,
    50.42189% 54.29979%,
    50.423% 54.34979%,
    50.42189% 54.39979%,
    50.423% 54.44979%,
    50.42189% 54.49979%,
    50.423% 54.54979%,
    50.42189% 54.60079%,
    27.2% 54.59979%,
    26.75% 54.60079%,
    26.3% 54.59979%,
    25.85% 54.60079%,
    25.4% 54.59979%,
    24.95% 54.60079%,
    24.5% 54.59979%,
    24.05% 54.60079%,
    23.6% 54.59979%,
    23.15% 54.60079%,
    22.7% 54.59979%,
    22.25% 54.60079%,
    21.8% 54.59979%,
    21.35% 54.60079%,
    20.9% 54.59979%,
    20.45% 54.60079%,
    20% 54.59979%,
    10.41708% 54.60079%,
    10.418% 54.54979%,
    10.41708% 54.49979%,
    10.418% 54.44979%,
    10.41708% 54.39979%,
    10.418% 54.34979%,
    10.41708% 54.29979%,
    10.418% 54.24979%,
    10.41708% 54.19979%,
    10.418% 54.14979%,
    10.41708% 54.09979%,
    10.418% 54.04979%,
    10.41708% 53.99979%,
    10.418% 53.94979%,
    10.41708% 53.89979%,
    10.418% 53.84979%,
    10.41708% 53.79979%,
    10.418% 53.74982%,
    10.41708% 53.69985%,
    10.418% 53.64987%,
    10.41708% 53.5999%,
    10.418% 53.54992%,
    10.41708% 53.49995%,
    10.418% 53.44997%
  );
          clip-path: polygon(
    10.41708% 53.4%,
    50.42189% 53.40079%,
    50.423% 53.44997%,
    50.42189% 53.49995%,
    50.423% 53.54992%,
    50.42189% 53.5999%,
    50.423% 53.64987%,
    50.42189% 53.69985%,
    50.423% 53.74982%,
    50.42189% 53.79979%,
    50.423% 53.84979%,
    50.42189% 53.89979%,
    50.423% 53.94979%,
    50.42189% 53.99979%,
    50.423% 54.04979%,
    50.42189% 54.09979%,
    50.423% 54.14979%,
    50.42189% 54.19979%,
    50.423% 54.24979%,
    50.42189% 54.29979%,
    50.423% 54.34979%,
    50.42189% 54.39979%,
    50.423% 54.44979%,
    50.42189% 54.49979%,
    50.423% 54.54979%,
    50.42189% 54.60079%,
    27.2% 54.59979%,
    26.75% 54.60079%,
    26.3% 54.59979%,
    25.85% 54.60079%,
    25.4% 54.59979%,
    24.95% 54.60079%,
    24.5% 54.59979%,
    24.05% 54.60079%,
    23.6% 54.59979%,
    23.15% 54.60079%,
    22.7% 54.59979%,
    22.25% 54.60079%,
    21.8% 54.59979%,
    21.35% 54.60079%,
    20.9% 54.59979%,
    20.45% 54.60079%,
    20% 54.59979%,
    10.41708% 54.60079%,
    10.418% 54.54979%,
    10.41708% 54.49979%,
    10.418% 54.44979%,
    10.41708% 54.39979%,
    10.418% 54.34979%,
    10.41708% 54.29979%,
    10.418% 54.24979%,
    10.41708% 54.19979%,
    10.418% 54.14979%,
    10.41708% 54.09979%,
    10.418% 54.04979%,
    10.41708% 53.99979%,
    10.418%.........完整代码请登录后点击上方下载按钮下载查看

网友评论0