是否可以使用内联样式的伪类?
例:
<a href="http://www.google.com" style="hover:text-decoration:none;">Google</a>
Run Code Online (Sandbox Code Playgroud)
我知道上面的HTML不起作用但有类似的东西吗?
PS我知道我应该使用外部样式表,我这样做.如果可以使用内联样式完成,我只是很好奇.
在 中styled-components,我试图通过传递 React Icon 来在悬停时渲染它,content但由于某种原因,我的悬停渲染是[Object Object]。
成分:
\nexport const FooLink = styled(Link)`\n padding: 0.5rem 2rem;\n color: ${({ theme }) => theme.colors.white};\n text-align: center;\n margin: 0 auto;\n position: relative;\n font-size: ${({ theme }) => theme.fontSizes.p};\n letter-spacing: 0.15em;\n transition: ${({ theme }) => theme.animations.trans3};\n\n &:after {\n content: \'${FaArrowRight}\';\n /* content: \'>\'; */\n position: absolute;\n opacity: 0;\n right: -${({ theme }) => theme.spacings.small};\n transition: ${({ theme }) => theme.animations.trans3};\n }\n\n &:hover {\n padding-right: ${({ theme …Run Code Online (Sandbox Code Playgroud) 不知何故,我必须以编程方式设置的宽度:before了div。
<div className="something" style={someStyle}> </div>
Run Code Online (Sandbox Code Playgroud)
我如何定义someStyle,这样的宽度:before的.something``div可发生相应的变化?