CSS漸層法
<div>some text</div>
div {
/* 無指定角度→由上到下 */
/* 0~50%純色(透明),50%~100%純色(藍色) */
/* 後色%小於前色%會變成色塊 */
background-image: linear-gradient(transparent 50%, rgba(173, 234, 234, 0.5) 50%);
}
Display
some text
HTML5法
<mark>some text</mark>
mark{
/* 可以調整顏色,但無法調整粗細度*/
color: black;
background-color: #fff9c0;
}
Display
some text