- CSS Tutorial
- CSS - Home
- CSS - Introduction
- CSS - Syntax
- CSS - Selectors
- CSS - Inclusion
- CSS - Measurement Units
- CSS - Colors
- CSS - Backgrounds
- CSS - Fonts
- CSS - Text
- CSS - Images
- CSS - Links
- CSS - Tables
- CSS - Borders
- CSS - Border Block
- CSS - Border Inline
- CSS - Margins
- CSS - Lists
- CSS - Padding
- CSS - Cursor
- CSS - Outlines
- CSS - Dimension
- CSS - Scrollbars
- CSS - Inline Block
- CSS - Dropdowns
- CSS - Visibility
- CSS - Overflow
- CSS - Clearfix
- CSS - Float
- CSS - Arrows
- CSS - Resize
- CSS - Quotes
- CSS - Order
- CSS - Position
- CSS - Hyphens
- CSS - Hover
- CSS - Display
- CSS - Focus
- CSS - Zoom
- CSS - Translate
- CSS - Height
- CSS - Hyphenate Character
- CSS - Width
- CSS - Opacity
- CSS - Z-Index
- CSS - Bottom
- CSS - Navbar
- CSS - Overlay
- CSS - Forms
- CSS - Align
- CSS - Icons
- CSS - Image Gallery
- CSS - Comments
- CSS - Loaders
- CSS - Attr Selectors
- CSS - Combinators
- CSS - Root
- CSS - Box Model
- CSS - Counters
- CSS - Clip
- CSS - Writing Mode
- CSS - Unicode-bidi
- CSS - min-content
- CSS - All
- CSS - Inset
- CSS - Isolation
- CSS - Overscroll
- CSS - Justify Items
- CSS - Justify Self
- CSS - Tab Size
- CSS - Pointer Events
- CSS - Place Content
- CSS - Place Items
- CSS - Place Self
- CSS - Max Block Size
- CSS - Min Block Size
- CSS - Mix Blend Mode
- CSS - Max Inline Size
- CSS - Min Inline Size
- CSS - Offset
- CSS - Accent Color
- CSS - User Select
- CSS Advanced
- CSS - Grid
- CSS - Grid Layout
- CSS - Flexbox
- CSS - Visibility
- CSS - Positioning
- CSS - Layers
- CSS - Pseudo Classes
- CSS - Pseudo Elements
- CSS - @ Rules
- CSS - Text Effects
- CSS - Paged Media
- CSS - Printing
- CSS - Layouts
- CSS - Validations
- CSS - Image Sprites
- CSS - Important
- CSS - Data Types
- CSS3 Tutorial
- CSS3 - Tutorial
- CSS - Rounded Corner
- CSS - Border Images
- CSS - Multi Background
- CSS - Color
- CSS - Gradients
- CSS - Box Shadow
- CSS - Box Decoration Break
- CSS - Caret Color
- CSS - Text Shadow
- CSS - Text
- CSS - 2d transform
- CSS - 3d transform
- CSS - Transition
- CSS - Animation
- CSS - Multi columns
- CSS - Box Sizing
- CSS - Tooltips
- CSS - Buttons
- CSS - Pagination
- CSS - Variables
- CSS - Media Queries
- CSS - Functions
- CSS - Math Functions
- CSS - Masking
- CSS - Shapes
- CSS - Style Images
- CSS - Specificity
- CSS - Custom Properties
- CSS Responsive
- CSS RWD - Introduction
- CSS RWD - Viewport
- CSS RWD - Grid View
- CSS RWD - Media Queries
- CSS RWD - Images
- CSS RWD - Videos
- CSS RWD - Frameworks
- CSS References
- CSS - Questions and Answers
- CSS - Quick Guide
- CSS - References
- CSS - Color References
- CSS - Web browser References
- CSS - Web safe fonts
- CSS - Units
- CSS - Animation
- CSS Resources
- CSS - Useful Resources
- CSS - Discussion
CSS - text-emphasis Property
In CSS, the text-emphasis property is used to add emphasis to text, such as adding some color, string or patterns around the text.
It is a shorthand property for the following properties:
text-emphasis-color: Sets the color of the emphasis marks around a text (color name, rgb value, hex code, rgba, etc.).
text-emphasis-style: Sets the style or appearance of the emphasis marks around a text (none, open, dot, circle, double-circle, sesame, etc.).
text-emphasis-position: Sets the position of the emphasis marks around a text.
Text Emphasis Color
The property text-emphasis-color is used to set the color of the emphasis marks around a text. If no color is specified, the currentcolor value is set as default value.
Possible Values
color name: Name of a color. Example = red, blue, etc.
RGB: An RGB value. Example = rgb(255,200,120)
RGBA: An RGBA value. Example = rgba(255,200,120,0.4).
HEX code: A hexadecimal code. Example = #ff00ff.
Applies to
All the HTML elements.
DOM Syntax
object.style.textEmphasisColor = "#ff00ff";
CSS text-emphasis - With Color
<html> <head> </head> <body> <h2>Text Emphasis</h2> <p style="text-emphasis-color: red; text-emphasis-style: '*';">Text Emphasis name.</p> <p style="text-emphasis-color: #00ffff; text-emphasis-style: dot;">Text Emphasis HEX code.</p> <p style="text-emphasis-color: rgb(235,120,90); text-emphasis-style: circle;">Text Emphasis RGB.</p> <p style="text-emphasis-color: rgba(2, 47, 24, 0.8); text-emphasis-style: triangle;">Text Emphasis RGBA.</p> </body> </html>
CSS text-emphasis-style
The property text-emphasis-style is used to add style to the emphasis marks around a text.
Possible Values
none: Sets no emphasis mark.
filled: Fills the element with solid color. Default value.
open: Sets the shape as hollow.
dot: Marks displayed as small circles, either open or filled dot.
circle: Marks displayed as large circles, either open or filled circle. Default shape in horizontal writing.
double-circle: Marks displayed as double circles, either open or filled double circle.
triangle: Marks displayed as triangles, either open or filled triangle.
sesame: Marks displayed as sesames (~), either open or filled sesame. Default shape in vertical writing.
<string>: Marks displayed as the passed string value.
<color>: Sets the color of the mark.
Applies to
All the HTML elements.
DOM Syntax
object.style.textEmphasisStyle = "circle";
CSS text-emphasis-style - Basic Example
Let us see an example:
<html> <head> </head> <body> <h2>Text Emphasis</h2> <p style="text-emphasis-style: 'm'; text-emphasis-color: blue;">Text Emphasis string.</p> <p style="text-emphasis-style: double-circle; text-emphasis-color: black;">Text Emphasis double-circle.</p> <p style="text-emphasis-style: filled circle; text-emphasis-color: rgb(235,120,90);">Text Emphasis filled circle.</p> <p style="text-emphasis-style: triangle; text-emphasis-color: rgba(2, 47, 24, 0.8);">Text Emphasis triangle.</p> </body> </html>
CSS text-emphasis - With Position
The property text-emphasis-position is used to set the position of the emphasis mark around a text.
Possible Values
over right
over left
under right
under left
left over
right under
left under
over: Marks drawn over the text in horizontal writing pattern.
under: Marks drawn under the text in horizontal writing pattern.
right: Marks drawn to the right of the text in vertical writing pattern.
left: Marks drawn to the left of the text in vertical writing pattern.
Positioning of emphasis marks is preferred based on the language. Like in chinese, the preferred position is under right, whereas in Japanese it is over right.
Applies to
All the HTML elements.
DOM Syntax
object.style.textEmphasisPosition = "over right";
Let us see an example:
<html> <head> </head> <body> <h2>Text Emphasis Position</h2> <p style="text-emphasis-style: 'm'; text-emphasis-color: blue; text-emphasis-position: over left;">Text Emphasis position.</p> <p style="text-emphasis-style: double-circle; text-emphasis-color: black; text-emphasis-position: under right">Text Emphasis position.</p> <p style="text-emphasis-style: filled circle; text-emphasis-color: rgb(235,120,90); text-emphasis-position: left under">Text Emphasis position.</p> <p style="text-emphasis-style: triangle; text-emphasis-color: rgba(2, 47, 24, 0.8); text-emphasis-position: left over">Text Emphasis position.</p> </body> </html>