最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Fade from normal text to italics text smoothly? - Stack Overflow

programmeradmin4浏览0评论

Is there a way to make it so when my user hovers over normal text that is an anchor, the text smoothly transitions into oblique or italicized text to show it is a link (including an underline)

Here's an example of what I'm trying to do...

<a href="">
<p class="footertext">Take me to the old site...</p>
</a>

p.footertext {
font-size:12px;
padding-left:4px;
text-decoration:none; }
p.footertext:hover {
/*text:decoration: "italicize smoothly"*/ }

Is there a way to make it so when my user hovers over normal text that is an anchor, the text smoothly transitions into oblique or italicized text to show it is a link (including an underline)

Here's an example of what I'm trying to do...

<a href="http://oldsite.">
<p class="footertext">Take me to the old site...</p>
</a>

p.footertext {
font-size:12px;
padding-left:4px;
text-decoration:none; }
p.footertext:hover {
/*text:decoration: "italicize smoothly"*/ }
Share Improve this question edited Sep 14, 2013 at 6:06 C Bonner asked Sep 14, 2013 at 5:57 C BonnerC Bonner 931 silver badge5 bronze badges 1
  • Not sure you can do that, at least not with plain CSS. – elclanrs Commented Sep 14, 2013 at 6:02
Add a ment  | 

2 Answers 2

Reset to default 17

You can use CSS3 transform functions to simulate italic text. You can also use CSS3 transitions to get the smooth transition you're looking for.

.italic {
    -moz-transition: all 1s;
    -webkit-transition: all 1s;
    -o-transition: all 1s;
    transition: all 1s;
}

.italic:hover {
    -webkit-transform: skewX(-20deg);
    -moz-transform: skewX(-20deg);
    -o-transform: skewX(-20deg);
    transform: skewX(-20deg);
}

JSFiddle

No. Skewed text is not the same as italicized text. An italic font is not simply a skewed font, it is pletely different. You can maybe cross-fade dissolve between the two, but skewed does not give you proper italicized text.

发布评论

评论列表(0)

  1. 暂无评论