Adding More Slant To Italic Text

2020-03-12 03:50发布

I was curious as to if you can impact italic text with more of a slant with CSS? If so, how can this be accomplished?

标签: css
3条回答
Evening l夕情丶
2楼-- · 2020-03-12 04:09

With standard font-style in CSS, it is not possible to customise the italic state.

This is up to the browsers own preference and the fonts italic state.

查看更多
冷血范
3楼-- · 2020-03-12 04:20

You can also use

font-style: oblique 50deg;

(you can change 50 to what angle you want)

查看更多
▲ chillily
4楼-- · 2020-03-12 04:25

You can simulate a custom slant with CSS3 skew transformations (although it will not look as great as a real italic font).

Here's an example:

HTML:

<p class="slant">Some text</p>

CSS

.slant {
    -moz-transform: scale(1) rotate(0deg) translate(0px, 0px) skew(30deg, 0deg);
    -webkit-transform: scale(1) rotate(0deg) translate(0px, 0px) skew(30deg, 0deg);
    -o-transform: scale(1) rotate(0deg) translate(0px, 0px) skew(30deg, 0deg);
    -ms-transform: scale(1) rotate(0deg) translate(0px, 0px) skew(30deg, 0deg);
    transform: scale(1) rotate(0deg) translate(0px, 0px) skew(30deg, 0deg);
}
查看更多
登录 后发表回答