Tutorial recommendation: css video tutorial
CSS font properties define the font family, size, boldness, style (such as italics) and Deformed (such as small caps) font-family controls fonts. Since the fonts installed in each computer system are different, there are basically three fonts: Heibody, Songti, and Microsoft Yahei.
font-size
Control the font size. When we set the font size, we set its width and height. Generally, the default font size of the computer system is 16px, so the font size should not be lower than 16px. 1em=16px;
font-weight: bold;
/*The control font weight is generally 100-900. Commonly used lighter (fine body) normal (normal) bold bold*/
As for this font-style
, the default is normal, which is normal. If you set font-style: italic; italic, it is actually the same as this The effect is almost the same; if the line-height used for the spacing between text is equal to the height, it will be vertically centered.
Usually the abbreviation of font font: font:style weight size/line-heigt font-family /*The two requirements that must appear are size and font-family*/
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>css常用样式font字体的多种变换</title> <style> div{ font-family: 'Microsoft YaHei';/*微软雅黑*/ /* font-family: 'Lucida Sans','Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif; */ /*字体加上双引号或者单引号,当有多个字体的时候,中间逗号分开*/ color:#f90; font-size: 24px;/*控制字体大小*/ font-weight: bold; /*控制字重 常用lighter(细体) normal(正常)bold加粗 */ font-style: italic;/*等同于em*/ line-height: 30px; } /*font字体的简写:font:style weight size/line-heigt font-family*/ /*要求必须出现的2个是 size font-family*/ p{ font: 24px/1.5em 'Lucida Sans','Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif; letter-spacing: 1px;/*英文字母间距*/ word-spacing: 10px;/*英文单词间距*/ } P::first-letter{ text-transform: capitalize; }/*第一个字母::first-letter*/ p::first-line{ color:red; }/*第一行::first-line*/ </style> </head> <body> <div>技术为王世界,欲问青天山顶景色是否独好技术为王世界, 欲问青天山顶景色是否独好技术为王世界,欲问青天山顶景色是否独好技术为王世界, 欲问青天山顶景色是否独好技术为王世界,欲问青天山顶景色是否独好技术为王世界, 欲问青天山顶景色是否独好技术为王世界, 欲问青天山顶景色是否独好技术为王世界,欲问青天山顶景色是否独好 </div> <p>Technology is king world, I want to ask if the scenery on the top of Qingtian Mountain is the king of technology, I want to ask whether the scenery of Qingtian Peak is the king of technology. If the technology is the king of the world, I would like to ask whether the scenery on the top of Qingtian Mountain is the king of the world. Is the scenery good?</p> </body> </html>
About style inheritance Question/*Styles related to text will be inherited*/The code is shown below:
<!doctype html> <html> <head> <meta charset="UTF-8"> <title>index</title> <style> p{ font-size: 20px; font-family: 微软雅黑; color:#f00; font-weight:bold; font-style:italic; word-spacing:15px; } </style> </head> <body> <div> <p><span>linux php linux</span></p> <p><span>linux linux php linux</span></p> <p><span>linux linux php linux</span></p> <p><span>linux linux php linux</span></p> </div> </body> </html>
For more programming-related knowledge, please visit: Programming Teaching! !
The above is the detailed content of css font controls multiple transformations of fonts. For more information, please follow other related articles on the PHP Chinese website!

What does it look like to refactor your own code? John Rhea picks apart an old CSS animation he wrote and walks through the thought process of optimizing it.

CSSanimationsarenotinherentlyhardbutrequirepracticeandunderstandingofCSSpropertiesandtimingfunctions.1)Startwithsimpleanimationslikescalingabuttononhoverusingkeyframes.2)Useeasingfunctionslikecubic-bezierfornaturaleffects,suchasabounceanimation.3)For

@keyframesispopularduetoitsversatilityandpowerincreatingsmoothCSSanimations.Keytricksinclude:1)Definingsmoothtransitionsbetweenstates,2)Animatingmultiplepropertiessimultaneously,3)Usingvendorprefixesforbrowsercompatibility,4)CombiningwithJavaScriptfo

CSSCountersareusedtomanageautomaticnumberinginwebdesigns.1)Theycanbeusedfortablesofcontents,listitems,andcustomnumbering.2)Advancedusesincludenestednumberingsystems.3)Challengesincludebrowsercompatibilityandperformanceissues.4)Creativeusesinvolvecust

Using scroll shadows, especially for mobile devices, is a subtle bit of UX that Chris has covered before. Geoff covered a newer approach that uses the animation-timeline property. Here’s yet another way.

Let’s run through a quick refresher. Image maps date all the way back to HTML 3.2, where, first, server-side maps and then client-side maps defined clickable regions over an image using map and area elements.

The State of Devs survey is now open to participation, and unlike previous surveys it covers everything except code: career, workplace, but also health, hobbies, and more.

CSS Grid is a powerful tool for creating complex, responsive web layouts. It simplifies design, improves accessibility, and offers more control than older methods.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Atom editor mac version download
The most popular open source editor

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Dreamweaver Mac version
Visual web development tools

Zend Studio 13.0.1
Powerful PHP integrated development environment
