This question already has answers here:
How to put a waved line under misspelled words HTML

(3个答案)


5年前关闭。




我可以这样创建波浪下划线:
我只能得到一个坚实的边界:

.err {
  border-bottom:1px solid red;
  display: inline-block;
}
<div>A boy whose name was Peter was <div class="err">woking</div> down the street</div>

最佳答案

(无背景图片):

.err {
  display: inline-block;
  position: relative;
}
.err:before {
  content: "~~~~~~~~~~~~";
  font-size: 0.6em;
  font-weight: 700;
  font-family: Times New Roman, Serif;
  color: red;
  width: 100%;
  position: absolute;
  top: 12px;
  left: -1px;
  overflow: hidden;
}
<div>A boy whose name was Peter was
  <div class="err">woking</div> down the street</div>


有背景图片:

.err {
    display: inline-block;
    position:relative;
    background: url(http://i.imgur.com/HlfA2is.gif) bottom repeat-x;
}
<div>A boy whose name was Peter was <div class="err">woking</div> down the street</div>

关于html - CSS中的波浪形下划线,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/28152175/

10-12 15:52