Fe-interview: [html] 第358天 给一个元素加下划线的方法有哪些?

Created on 7 Apr 2020  ·  1Comment  ·  Source: haizlin/fe-interview

第358天 给一个元素加下划线的方法有哪些?

我也要出题

html

Most helpful comment

  1. 使用 <u></u> 标签
  2. 给元素添加 boder-bottom
  3. 文字样式 text-decoration: underline;
  4. 使用伪类或者子元素做绝对定位
.target {
  position: relative;
}
.underline {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background-color: black;
}

>All comments

  1. 使用 <u></u> 标签
  2. 给元素添加 boder-bottom
  3. 文字样式 text-decoration: underline;
  4. 使用伪类或者子元素做绝对定位
.target {
  position: relative;
}
.underline {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background-color: black;
}
Was this page helpful?
0 / 5 - 0 ratings