般若波罗蜜多心经
觀自在菩薩 ⸰
在网页设计中融入梵文装饰元素,能为页面增添神秘而庄重的东方宗教氛围。本文将深入探讨如何通过CSS的text-decoration
属性和其他辅助技术实现这一效果。
传统text-decoration
仅支持underline
、overline
等简单样式,但通过组合技可创造出复杂的梵文装饰:
css
.sanskrit {
text-decoration: overline dotted #d4af37;
text-decoration-skip-ink: none;
position: relative;
}
css
.vedic-text {
text-decoration: overline double #8B4513;
text-underline-offset: 0.2em;
letter-spacing: 0.1em;
}
css
.bija-mantra {
text-shadow: 0 0 5px #ffd700, 0 0 10px #ff4500;
position: relative;
}
.bija-mantra::after {
content: "🜚";
position: absolute;
left: 50%;
top: -1em;
transform: translateX(-50%);
}
css
@keyframes rotate-symbol {
from { transform: rotate(0deg) }
to { transform: rotate(360deg) }
}
.prayer-wheel::before {
content: "卍";
animation: rotate-symbol 20s linear infinite;
display: inline-block;
margin-right: 0.5em;
}
html
ॐ मणिपद्मे हूं
css
.palm-leaf {
background: url('palm-texture.jpg');
padding: 2em;
border-left: 3px solid #5e2c04;
box-shadow: inset 0 0 30px rgba(94, 44, 4, 0.3);
}
css
/* 启用GPU加速 */
.decorative-element {
will-change: transform;
backface-visibility: hidden;
}
/* 替代高耗能效果 /
.text-glow {
/ 替代box-shadow实现发光效果 */
filter: drop-shadow(0 0 2px rgba(255,215,0,0.7));
}
html
觀自在菩薩 ⸰
css
.sanskrit-title {
text-decoration: overline wavy #c19a6b;
text-underline-position: under;
font-family: "Sanskrit Text", serif;
}
.mantra-highlight {
background: linear-gradient(to right, transparent 10%, #fff3e0 50%, transparent 90%);
text-decoration-color: #d4af37;
}