Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to change to the underline height from when the developer uses `text-decoration: underline;` in CSS to create an underline?

Tags:

html

css

Is it possible to change to the underline height from when the developer uses text-decoration: underline; in CSS to create an underline?

Using CSS I made the word "about" which has an 'id' of '#title4' have an underline and I was wondering how I can change the distance of the height from the underline to the word so there is a bigger gap between both?

Example of what I'm looking for

enter image description here

#title4 {
font-size: 2.5rem;
font-weight: 700;
margin-top: 5rem;
text-decoration: underline;
}

Site code

like image 688
Jon Bridge Avatar asked Aug 08 '17 10:08

Jon Bridge


People also ask

How do I change the height of an underline in HTML?

unfortunately, you cannot control text-decoration height and spacing between text.

How do you change underline in CSS?

In CSS, we will use text-decoration property to style underline. CSS text-decoration-color Property: This property is used to specify the color of decorations (overlines, underlines, and line-throughs) over the text.

How do I change the size of an underline in CSS?

You cannot modify the width of underline tag. Instead go for Border-bottom approach and change it's properties as required.

How do you underline a text in CSS?

The property text-decoration-line is used to underline the text. This property has three values that are overline, underline, or line-through. So, the value underline is used to underline the text in CSS. This value draws the underline beneath the inline text.


1 Answers

The text-decoration-thickness CSS property sets the thickness, or width, of the decoration line that is used on text in an element, such as a line-through, underline, or overline.

(Edge 87, Firefox 70, Safari 12, Chrome 87)

Syntax: auto | from-font | |

e.g.

 .css_class
{
  text-decoration: underline;
  text-decoration-color: red;
  text-decoration-style: solid;
  text-decoration-thickness: 5px;
}
<div class="css_class">Test</div>
like image 141
Alex Avatar answered Sep 29 '22 17:09

Alex