【问题标题】:CSS on hover animation text flip not working? [duplicate]悬停动画文本翻转上的 CSS 不起作用? [复制]
【发布时间】:2018-11-15 11:01:10
【问题描述】:

由于某种原因,我无法让这个使用原点和伪元素的简单 css 动画工作,文本应该在自己的中心翻转。

看一下代码:

.flip{
    border: none;
	background-color:none;
	color: black;
	padding: 5px 10px;
	font-size: 18px;
	border-radius: 4px;
	position: relative;
	box-sizing: border-box;
	transition: all 500ms ease; 
	transform-style: preserve-3d;
}

flip:after {
	top: -100%;
	left: 0px;
	width: 100%;
	position: absolute;
	background: none;
	border-radius: 4px;
	content: 'flipped';
	transform-origin: left bottom;
	transform: rotateX(90deg);
}

flip:hover {
	transform-origin: center bottom;
	transform: rotateX(-90deg) translateY(100%);
}
<a class="flip" href="">flip</a>

【问题讨论】:

  • display:inline-block; 在您的元素上并更正选择器

标签: html css animation effect


【解决方案1】:

您缺少一个“。”在 css 中的类名之前

【讨论】:

  • 不仅如此......顺便说一句,我认为它不适合回答拼写错误
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-12-21
  • 1970-01-01
  • 2021-02-15
  • 2021-09-26
  • 1970-01-01
  • 2014-09-07
相关资源
最近更新 更多