Front-end Tutorials

Front-end Tutorials

HTMLCSSSassJavaScriptReactJS
CMS Tutorials

CMS Tutorials

WordPress
Tutorials expand

CSS Properties

CSS text-emphasis-style Property

Posted in CSS Tutorial
Updated on Oct 13, 2024
By Mari Selvan
👁️ 14 - Views
⏳ 4 mins
💬 1 Comment
CSS text-emphasis-style Property

Photo Credit to CodeToFun

🙋 Introduction

The text-emphasis-style property in CSS is used to apply emphasis marks to text, which can help to highlight or stress certain parts of the content.

This property is commonly used in East Asian typography, but it can be applied to any text to add stylistic emphasis.

💡 Syntax

The syntax for the text-emphasis-style property is straightforward. You can specify the emphasis mark using predefined keywords or a string.

Syntax
Copied
Copy To Clipboard
element {
  text-emphasis-style: style;
}

Here, style can be one of the predefined keywords or a string representing the custom emphasis mark.

🎛️ Default Value

The default value of the text-emphasis-style property is none, meaning no emphasis marks are applied.

🏠 Property Values

ValueDescription
noneNo emphasis mark.
accentUses the accent mark (emphasis dot).
dotUses a small dot as the emphasis mark.
circleUses a small open circle as the emphasis mark.
double-circleUses a small filled circle with an outer open circle.
triangleUses a small triangle as the emphasis mark.
sesameUses a sesame dot as the emphasis mark.
stringA custom emphasis mark provided as a string.

📄 Example

In this example, we'll apply a dot emphasis mark to some text.

index.html
Copied
Copy To Clipboard
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>CSS text-emphasis-style Example</title>
  <style>
    p {
      text-emphasis-style: dot;
    }
  </style>
</head>
<body>
  <h1>Text with Emphasis Style</h1>
  <p>This text has an emphasis mark applied to it.</p>
</body>
</html>

🖥️ Browser Compatibility

The text-emphasis-style property is supported in modern browsers, including the latest versions of Chrome, Firefox, Safari, and Edge. However, as with any CSS property, it is advisable to test your website across different browsers to ensure consistent behavior.

🎉 Conclusion

The text-emphasis-style property is a useful tool for adding typographic emphasis to your text content.

Whether you are designing for East Asian languages or simply want to add some stylistic touches to your text, this property offers a range of predefined options and the flexibility to create custom emphasis marks. Experiment with different styles and see how they can enhance the readability and visual appeal of your web projects.

👨‍💻 Join our Community:

To get interesting news and instant updates on Front-End, Back-End, CMS and other Frameworks. Please Join the Telegram Channel:

Author

author
👋 Hey, I'm Mari Selvan

For over eight years, I worked as a full-stack web developer. Now, I have chosen my profession as a full-time blogger at codetofun.com.

Buy me a coffee to make codetofun.com free for everyone.

Buy me a Coffee

Share Your Findings to All

Subscribe
Notify of
guest
1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
We make use of cookies to improve our user experience. By using this website, you agree with our Cookies Policy
AgreeCookie Policy