How to reduce text in css3

藏色散人
Release: 2022-12-30 11:11:33
Original
3967 people have browsed it

How to reduce text in css3: First create an HTML sample file; then define a p tag; finally use the "transform:scale(x)" style to reduce the text.

How to reduce text in css3

The operating environment of this tutorial: windows7 system, HTML5&&CSS3 version, Dell G3 computer.

Recommended: css video tutorial

css3 shrink text

transform:scale(x), for overall scaling , the overall scale includes width, height, and background. Naturally, this attribute cannot be used for inline elements. It is best to use span without attributes to convert it into a block element or an inline block element for setting, so as to achieve its own scaling while ensuring that the outer elements remain unchanged.

CSS:

@media screen and (min-width:320px){font-size: 12px;}
@media screen and (min-width:360px){font-size: 14px;}
@media screen and (min-width:420px){font-size: 16px;}
@media screen and (min-width:480px){font-size: 20px;}
@media screen and (min-width:520px){font-size: 24px;}
@media screen and (min-width:640px){font-size: 28px;}
@media screen and (min-width:750px){font-size: 32px;}
.font1{font-size: 1rem;}.displayIB{display:inline-block;}.scaleFont{transform: scale(0.58);}
Copy after login

HTML:

测试888测试

Copy after login

How to reduce text in css3

The above is the detailed content of How to reduce text in css3. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!