Can CSS Stretch Text Without Changing Font Size?
Oct 27, 2024 pm 04:29 PMCan CSS Create Text Deformation?
Question: Is it possible to stretch text using CSS without altering font size? The desired effect is vertical deformation, making the text appear elongated.
Answer: Yes, CSS 2D Transforms enables text deformation. Browser support is extensive, encompassing all major browsers post-IE9.
Here's an example of how to achieve this effect:
<code class="css">span.stretch { display:inline-block; -webkit-transform:scale(2,1); /* Safari and Chrome */ -moz-transform:scale(2,1); /* Firefox */ -ms-transform:scale(2,1); /* IE 9 */ -o-transform:scale(2,1); /* Opera */ transform:scale(2,1); /* W3C */ }</code>
<code class="html"><p>I feel like <span class="stretch">stretching</span>.</p></code>
This code creates a deformed "stretching" span within a normal text paragraph.
The above is the detailed content of Can CSS Stretch Text Without Changing Font Size?. For more information, please follow other related articles on the PHP Chinese website!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Adding Box Shadows to WordPress Blocks and Elements

Create a JavaScript Contact Form With the Smart Forms Framework

Making Your First Custom Svelte Transition

Demystifying Screen Readers: Accessible Forms & Best Practices

Comparing the 5 Best PHP Form Builders (And 3 Free Scripts)
