小编use*_*427的帖子

标签背景颜色幻灯片过渡到下一个标签

我正在尝试实现背景转换,当您单击选项卡时,当前选项卡的背景会滑动到单击的选项卡。任何人都可以帮忙吗?

*,
*:before,
*:after {
  box-sizing: border-box;
}

.radio_wrap {}

input {
  position: absolute;
  opacity: 0;
}

label {
  min-width: calc(100% / 4);
  position: relative;
  float: left;
  text-align: center;
  text-shadow: none;
  padding: 20px;
  border: 1px solid #dfe0e4;
  color: grey;
  font-size: 14px;
  position: relative;
  transition: background-color .3s ease-in-out;
}

input:checked+label {
  background: grey;
  color: white;
}
Run Code Online (Sandbox Code Playgroud)
<div class="radio_wrap">
  <input type="radio" id="radio1" name="radio1">
  <label for="radio1">tab1</label>
  <input type="radio" id="radio2" name="radio1">
  <label for="radio2">tab2</label>
  <input type="radio" id="radio3" name="radio1">
  <label for="radio3">tab3</label>
  <input type="radio" id="radio4" name="radio1">
  <label …
Run Code Online (Sandbox Code Playgroud)

css css-transitions css-animations

4
推荐指数
1
解决办法
1781
查看次数

SVG 文本背景颜色,边框半径和填充与文本宽度相匹配

我需要在 SVG 内的文本元素周围环绕背景,它需要有填充和边框半径。问题是文本将是动态的,所以我需要背景来扩大文本的宽度。我找到了一个使用外来对象的解决方案,但这在 IE 11 中不受支持,这是一个问题。任何人都可以提出解决方法。

svg

0
推荐指数
1
解决办法
4586
查看次数

标签 统计

css ×1

css-animations ×1

css-transitions ×1

svg ×1