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 – Adding More Slant to Italic Text
css
Related Solutions
In the purest (type designer) sense, an oblique is a roman font that has been skewed a certain number of degrees (8-12 degrees, usually). An italic is created by the type designer with specific characters (notably lowercase a) drawn differently to create a more calligraphic, as well as slanted version.
Some type foundries have arbitrarily created obliques that aren't necessarily approved by the designers themselves... some fonts were meant not to be italicized or obliqued... but people did anyway. And as you may know, some operating systems will, upon clicking the 'italic' icon, skew the font and create an oblique on the fly. Not a pleasant sight.
It's best to specify an italic only when you're sure that font has been designed with one.
I updated jos' demo to use jQuery to wrap each letter in a span, then transform each letter using the example from Mozilla's transform docs & a demo:
HTML
<div id="skewed">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque eu metus nisi.
Integer non adipiscing massa. Etiam et diam magna. Mauris sit amet arcu dui, a
malesuada erat.
</div>
jQuery
// html function requires jQuery 1.4+
$('#skewed').html(function (i, h) {
h = h.replace(/\s+/g, '\u00a0').split('');
return '<span>' + h.join('</span><span>') + '</span>';
});
CSS
#skewed {
font: 24px Georgia, sans-serif;
background: #ccc;
padding: 10px 20px;
}
#skewed span {
display: inline-block;
/* see https://developer.mozilla.org/en-US/docs/CSS/transform */
-webkit-transform: skewx(20deg);
-o-transform: skewx(20deg);
transform: skewx(20deg);
}
Best Answer
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:
CSS