css font controls multiple transformations of fonts
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!

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

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

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



The default style of the Bootstrap list can be removed with CSS override. Use more specific CSS rules and selectors, follow the "proximity principle" and "weight principle", overriding the Bootstrap default style. To avoid style conflicts, more targeted selectors can be used. If the override is unsuccessful, adjust the weight of the custom CSS. At the same time, pay attention to performance optimization, avoid overuse of !important, and write concise and efficient CSS code.

How to use the Bootstrap button? Introduce Bootstrap CSS to create button elements and add Bootstrap button class to add button text

To use Bootstrap to layout a website, you need to use a grid system to divide the page into containers, rows, and columns. First add the container, then add the rows in it, add the columns within the row, and finally add the content in the column. Bootstrap's responsive layout function automatically adjusts the layout according to breakpoints (xs, sm, md, lg, xl). Different layouts under different screen sizes can be achieved by using responsive classes.

To create a Bootstrap framework, follow these steps: Install Bootstrap via CDN or install a local copy. Create an HTML document and link Bootstrap CSS to the <head> section. Add Bootstrap JavaScript file to the <body> section. Use the Bootstrap component and customize the stylesheet to suit your needs.

There are several ways to insert images in Bootstrap: insert images directly, using the HTML img tag. With the Bootstrap image component, you can provide responsive images and more styles. Set the image size, use the img-fluid class to make the image adaptable. Set the border, using the img-bordered class. Set the rounded corners and use the img-rounded class. Set the shadow, use the shadow class. Resize and position the image, using CSS style. Using the background image, use the background-image CSS property.

The file upload function can be implemented through Bootstrap. The steps are as follows: introduce Bootstrap CSS and JavaScript files; create file input fields; create file upload buttons; handle file uploads (using FormData to collect data and then send to the server); custom style (optional).

Bootstrap provides a simple guide to setting up navigation bars: Introducing the Bootstrap library to create navigation bar containers Add brand identity Create navigation links Add other elements (optional) Adjust styles (optional)

To verify dates in Bootstrap, follow these steps: Introduce the required scripts and styles; initialize the date selector component; set the data-bv-date attribute to enable verification; configure verification rules (such as date formats, error messages, etc.); integrate the Bootstrap verification framework and automatically verify date input when form is submitted.
