【发布时间】:2023-03-23 20:15:01
【问题描述】:
我想在 Django 中创建一个完整的文本。间隙应显示丢失了多少个字母。 例如: 这是一个例子。我会 sh_ _ 你是我的我_ _。
我在codepen 上发现了一些有用的 css-sn-p。我尝试使用它并使用字母而不是数字并将字体更改为 Segoe UI。我遇到的问题是,当我使用 Segoe UI 时,下划线不再与字母同步。我要如何更改配置才能再次适应?
我的 SCSS 代码:
$char-w: 1ch;
$gap: .5*$char-w;
$n-char: 7;
$in-w: $n-char*($char-w + $gap);
input {
display: block;
margin: 2em auto;
border: none;
padding: 0;
width: $in-w;
background: repeating-linear-gradient(90deg,
dimgrey 0, dimgrey $char-w,
transparent 0, transparent $char-w + $gap)
0 100%/ #{$in-w - $gap} 2px no-repeat;
font: 5ch Segoe UI; /*That's the attribute i changed*/
letter-spacing: $gap;
&:focus {
outline: none;
color: dodgerblue;
}
}
我的 HTML 代码:
<input maxlength='7' value=''/>
【问题讨论】: