CSS - Font-style propriety - Oblique with variable angle

672 Views Asked by At

I would like to choose the angle of inclination of an font with the "font-style: oblique "angle""

Like on this example: https://developer.mozilla.org/en-US/docs/Web/CSS/font-style

I would also like to use negative angle

But I think I missed a detail, when I'm using the exact same snippet in my code the text is always displayed with the default value of inclination (14deg).

Should I use specific font/browser or another css propriety?

Browser : firefox 97.0.1

h2 {
   font-style: oblique 30deg;
}
<h2>Oblique text with 30deg angle<h2>

Thanks for your answer

2

There are 2 best solutions below

0
Dakshank On

The reference itself says browser compatibility as given link https://developer.mozilla.org/en-US/docs/Web/CSS/font-style#browser_compatibility

So oblique <angle> css is not compatible with any other browser except Firefox. You can use italic style or different font family that has same style.

0
Hola Soy Edu Feliz Navidad On

It seems to be for an illogical behaviour. Even if you specify the degrees the oblique searches for the standard font oblique. It it is not available then it uses italic. Only if both cases are not found is when it generates its own oblique with the specified degrees. In a nutshell: It will only work if your font doesn't have oblique neither italic.