1. Introduction In the past, if you wanted to emphasize a certain part of the text, you usually did it by making it bold or using a bright color. Now there is a new option, which is to use There are 4 CSS properties in
Among them, 2. Details 1. text-emphasis-color 2. text-emphasis-style There are three main types of text-emphasis-style: none text-emphasis-style: [ filled | open ] || [ dot | circle | double-circle | triangle | sesame ] text-emphasis-style: <string> in: Baby, <span class="emphasis">love you</span>, <span class="emphasis">heart</span>! .emphasis { -webkit-text-emphasis-style: '❤'; text-emphasis-style: '❤'; } The effect is shown in the figure below. You can see that a heart character appears above the corresponding text (because the Emoji font is applied, the Emoji character is displayed). Here are a few details to share with you: The font size of the emphasis decorator displayed is half the font size of the main text content. For example, if the text is If multiple characters are specified, only the first character will be used as the emphasis modifier. For example: text-emphasis-style: 'CSS New World'; is equivalent to: text-emphasis-style: 'C'; Finally, let’s take a look at the built-in decorative character effects of Each decorator has two types of characters: filled and hollow, which are determined by the two keywords For example: /* Solid dot */ text-emphasis: filled dot; /*Hollow dot*/ text-emphasis: open dot; Since built-in characters are solid by default, If /* Equivalent to text-emphasis: filled dot */ text-emphasis: filled; /* Equivalent to text-emphasis: open dot */ text-emphasis: open; As for the specific effects of each decorative symbol, I (Zhang Xinxu) specially made a table for your convenience. See the table below for details. The font size of each emphasis decorator is greatly affected by the font. You can choose to use the appropriate emphasis decorator according to the actual scenario. 3. Text-emphasis-position The syntax is as follows: text-emphasis-position: [ over | under ] && [ right | left ] Usage instructions: text-emphasis-position: over left; text-emphasis-position: under right; text-emphasis-position: under left; text-emphasis-position: left over; text-emphasis-position: right under; text-emphasis-position: left under; The initial value of Therefore, to emphasize Chinese content, in addition to setting the emphasis decorator, you also need to set the position of the emphasis decorator to the bottom, for example: .chinese-emphasis { -webkit-text-emphasis: dot; text-emphasis: dot; -webkit-text-emphasis-position: under right; text-emphasis-position: under right; } Here is a small detail. In Chrome browser, -webkit-text-emphasis-position: under; However, please note that this approach of the Chrome browser is actually wrong and does not conform to the specification description. The specification requires that -webkit-text-emphasis-position: under right; 4. Text-emphasis text-emphasis: circle deepskyblue; In terms of syntax and semantics, The only thing worth mentioning is that Another small difference is that 3. Summary I reviewed the projects I have experienced and found places where In short, the CSS Finally, let’s show the browser compatibility of Summarize This is the end of this article about using CSS text-emphasis to emphasize text. For more relevant CSS text-emphasis text decoration content, please search 123WORDPRESS.COM’s previous articles or continue to browse the related articles below. I hope that everyone will support 123WORDPRESS.COM in the future! |
<<: How to create a style guide for your website in web interface design (with pictures and text)
>>: Detailed example of HTML element blocking Flash
This article example shares the specific code of ...
Table of contents Preface Summary of the principl...
This is a cheating scheme for voting websites wit...
Template 1: login.vue <template> <p clas...
Table of contents 1. Problem 2. Solution 1. Decla...
The following functions are implemented: 1. Usern...
1: Install SVN yum install -y subversion 2. Creat...
This article shares the specific code for JavaScr...
Quick Start 1. Find the nginx image on Docker Hub...
Table of contents About Kubernetes Basic environm...
Use JOIN instead of sub-queries MySQL supports SQ...
1. Create a new user: 1. Execute SQL statement to...
Solution to 1449 and 1045 exceptions when connect...
<br />Tips for making web table frames. ----...
Use blockquote for long citations, q for short ci...