gpt4 book ai didi

css首字母转换?

转载 作者:太空宇宙 更新时间:2023-11-04 00:54:27 25 4
gpt4 key购买 nike

我试图在鼠标悬停时翻转 h1 标签的第一个字母,但不起作用!

<html>
<head>
<style>


h1 {
color: #FF0000;
}

h1:first-letter:hover {

color: #000;
transform: scaleX(-1);
transition: all 3s ease-in-out 0s;

}

</style>
</head>

<body>

<h1>RISVOLTO</h1>


</body>
</html>

我当然不明白该怎么做:(

最佳答案

正如其他人提到的,这是不可能的。

但是,如果您能够编辑 HTML,则可以将第一个字母包装在另一个元素中并对其进行转换。

<html>

<head>
<style>
h1 {
color: #FF0000;
}

h1 span {
display: inline-block;
transition: all 3s ease-in-out 0s;
}

h1:hover span {
color: #000;
transform: scaleX(-1);
}
</style>
</head>

<body>

<h1><span>R</span>ISVOLTO</h1>


</body>

</html>

关于css首字母转换?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55125692/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com