ویژگی text-decoration

ویژگی text-decoration چگونگی تزئین متن را مشخص می کند.
مقادیر متداول :
none - مقدار پیش فرض ، بصورت عادی
inherit - ارثبری از عنصر والدین
overline - خط افقی در بالای متن
underline - خط افقی در زیر متن
line-through - خط افقی روی متن ( HTML در <del> جایگزین برچسب)

مثال زیر تفاوت بین هر مقدار را نشان می دهد.

HTML : 

 <p class="none">This is default style of the text (none).</p>
 <p class="inherit">This text inherits the decoration of the parent.</p>
 <p class="overline">This is overlined text.</p>
 <p class="underline">This is underlined text.</p>
 <p class="line-through">This is lined-through text.</p>

CSS : 

 p.none {
    text-decoration: none;
 }
 p.inherit {
    text-decoration: inherit;
 }
 p.overline {
    text-decoration: overline;
 }
 p.underline {
    text-decoration: underline;
 }
 p.line-through {
    text-decoration: line-through;
 }
نتیجه کد

This is default style of the text (none).

This text inherits the decoration of the parent.

This is overlined text.

This is underlined text.

This is lined-through text.


شما می توانید مقادیر underline ، overline یا line-through را همزمان و با ایجاد فاصله بین آنها استفاده کنید.