How to add a dotted underline beneath HTML text with CSS?

Spread the love

Sometimes, we want to add a dotted underline beneath HTML text with CSS.

In this article, we’ll look at how to add a dotted underline beneath HTML text with CSS.

How to add a dotted underline beneath HTML text with CSS?

To add a dotted underline beneath HTML text with CSS, we set the border-bottom property.

For instance, we write

u {
  border-bottom: 1px dotted #000;
  text-decoration: none;
}

to set border-bottom to 1px dotted #000 to mnake the bottom border of the u element a dotted line 1px thick with color #000.

Conclusion

To add a dotted underline beneath HTML text with CSS, we set the border-bottom property.

Leave a Reply

Your email address will not be published. Required fields are marked *