Decorative underline for CSS elements

The style sheet technology performs two functions in the design of HTML pages. Firstly, with its help, the position of individual elements of the site is formed. Secondly, it makes the blocks visually appealing to the user. The second function is implemented in various ways. One of them is underlining. CSS provides for this attribute text- decoration .

Attribute record specification

Using the text- decoration property is simple. It is enough to write the following line for the element in the code of the stylesheet:

text- decoration: attribute_value ;

Instead of attribute_value , the CSS specification offers a number of options:

  • underline - the line is located strictly under the text;
  • overline – ;
  • none – ;
  • inherit – -.

underscore css




, CSS, , «» .

- : ? - , – , .





underline. . , CSS:

a {text-decoration: none;}

:

a:hover {text-decoration: underline;}

text-decoration :

  • , «»;
  • . CSS .

underline css links




. <span>.

:

<a href="#" style="text-decoration: underline; color: red">

<span style="color:blue"></span>

</a>.</p>

, .

, CSS, border-bottom. :

a {border-bottom:1px solid red;}

, . . ( – red), :

  • dotted;
  • dashed – ;
  • double – .

, border-bottom . , .




All Articles