
- CSS 教程
- CSS - 首頁
- CSS - 路線圖
- CSS - 簡介
- CSS - 語法
- CSS - 選擇器
- CSS - 包含
- CSS - 測量單位
- CSS - 顏色
- CSS - 背景
- CSS - 字型
- CSS - 文字
- CSS - 圖片
- CSS - 連結
- CSS - 表格
- CSS - 邊框
- CSS - 塊級邊框
- CSS - 內聯邊框
- CSS - 外邊距
- CSS - 列表
- CSS - 內邊距
- CSS - 游標
- CSS - 輪廓
- CSS - 尺寸
- CSS - 捲軸
- CSS - 內聯塊
- CSS - 下拉選單
- CSS - 可見性
- CSS - 溢位
- CSS - Clearfix
- CSS - 浮動
- CSS - 箭頭
- CSS - 調整大小
- CSS - 引號
- CSS - 順序
- CSS - 位置
- CSS - 連字元
- CSS - 懸停
- CSS - 顯示
- CSS - 聚焦
- CSS - 縮放
- CSS - 轉換
- CSS - 高度
- CSS - 連字元字元
- CSS - 寬度
- CSS - 不透明度
- CSS - Z-Index
- CSS - 底部
- CSS - 導航欄
- CSS - 覆蓋層
- CSS - 表單
- CSS - 對齊
- CSS - 圖示
- CSS - 圖片庫
- CSS - 註釋
- CSS - 載入器
- CSS - 屬性選擇器
- CSS - 組合器
- CSS - 根
- CSS - 盒模型
- CSS - 計數器
- CSS - 剪輯
- CSS - 書寫模式
- CSS - Unicode-bidi
- CSS - min-content
- CSS - All
- CSS - Inset
- CSS - Isolation
- CSS - Overscroll
- CSS - Justify Items
- CSS - Justify Self
- CSS - Tab Size
- CSS - 指標事件
- 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 高階
- CSS - 網格
- CSS - 網格佈局
- CSS - Flexbox
- CSS - 可見性
- CSS - 定位
- CSS - 圖層
- CSS - 偽類
- CSS - 偽元素
- CSS - @規則
- CSS - 文字效果
- CSS - 分頁媒體
- CSS - 列印
- CSS - 佈局
- CSS - 驗證
- CSS - 圖片精靈
- CSS - Important
- CSS - 資料型別
- CSS3 教程
- CSS3 - 教程
- CSS - 圓角
- CSS - 邊框圖片
- CSS - 多背景
- CSS - 顏色
- CSS - 漸變
- CSS - 盒陰影
- CSS - 盒裝飾中斷
- CSS - Caret Color
- CSS - 文字陰影
- CSS - 文字
- CSS - 2d 變換
- CSS - 3d 變換
- CSS - 過渡
- CSS - 動畫
- CSS - 多列
- CSS - 盒尺寸
- CSS - 提示框
- CSS - 按鈕
- CSS - 分頁
- CSS - 變數
- CSS - 媒體查詢
- CSS - 函式
- CSS - 數學函式
- CSS - 遮罩
- CSS - 形狀
- CSS - 樣式圖片
- CSS - 特異性
- CSS - 自定義屬性
- CSS 響應式
- CSS RWD - 簡介
- CSS RWD - 視口
- CSS RWD - 網格檢視
- CSS RWD - 媒體查詢
- CSS RWD - 圖片
- CSS RWD - 影片
- CSS RWD - 框架
- CSS 工具
- CSS - PX 到 EM 轉換器
- CSS - 顏色選擇器和動畫
- CSS 資源
- CSS - 有用資源
- CSS - 討論
CSS - text-emphasis 屬性
在 CSS 中,text-emphasis 屬性用於為文字新增強調效果,例如在文本週圍新增一些顏色、字串或圖案。
它是一個以下屬性的簡寫屬性
text-emphasis-color:設定文本週圍強調標記的顏色(顏色名稱、rgb 值、十六進位制程式碼、rgba 等)。
text-emphasis-style:設定文本週圍強調標記的樣式或外觀(none、open、dot、circle、double-circle、sesame 等)。
text-emphasis-position:設定文本週圍強調標記的位置。
文字強調顏色
text-emphasis-color 屬性用於設定文本週圍強調標記的顏色。如果未指定顏色,則預設值為 currentcolor。
可能的值
顏色名稱:顏色的名稱。例如 = red、blue 等。
RGB:RGB 值。例如 = rgb(255,200,120)
RGBA:RGBA 值。例如 = rgba(255,200,120,0.4)。
十六進位制程式碼:十六進位制程式碼。例如 = #ff00ff。
應用於
所有 HTML 元素。
DOM 語法
object.style.textEmphasisColor = "#ff00ff";
CSS text-emphasis - 帶顏色
<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
text-emphasis-style 屬性用於為文本週圍的強調標記新增樣式。
可能的值
none:不設定強調標記。
filled:用純色填充元素。預設值。
open:將形狀設定為空心。
dot:標記顯示為小圓圈,可以是空心或實心圓點。
circle:標記顯示為大圓圈,可以是空心或實心圓圈。水平書寫中的預設形狀。
double-circle:標記顯示為雙圓圈,可以是空心或實心雙圓圈。
triangle:標記顯示為三角形,可以是空心或實心三角形。
sesame:標記顯示為芝麻 (~),可以是空心或實心芝麻。垂直書寫中的預設形狀。
<string>:標記顯示為傳遞的字串值。
<color>:設定標記的顏色。
應用於
所有 HTML 元素。
DOM 語法
object.style.textEmphasisStyle = "circle";
CSS text-emphasis-style - 基本示例
讓我們來看一個例子
<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 - 帶位置
text-emphasis-position 屬性用於設定文本週圍強調標記的位置。
可能的值
over right
over left
under right
under left
left over
right under
left under
over:在水平書寫模式下在文字上方繪製標記。
under:在水平書寫模式下在文字下方繪製標記。
right:在垂直書寫模式下在文字右側繪製標記。
left:在垂直書寫模式下在文字左側繪製標記。
強調標記的位置根據語言而定。例如,在中文中,首選位置是 under right,而在日語中是 over right。
應用於
所有 HTML 元素。
DOM 語法
object.style.textEmphasisPosition = "over right";
讓我們來看一個例子
<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>