当我输入最后一个数字时,第一个数字进入text-box
(它消失)里面,它增加了一个额外的空格。
在我点击外部后,text-box
它看起来不错,这是我在输入最后一个字符时需要的。
#number_text {
padding-left: 9px;
letter-spacing: 31px;
border: 0;
background-image: linear-gradient(to right, #e1e1e1 70%, rgba(255, 255, 255, 0) 0%);
background-position: left bottom;
background-size: 38px 1px;
background-repeat: repeat-x;
width: 220px;
box-sizing: border-box;
outline:none;
}
Run Code Online (Sandbox Code Playgroud)
<input type="text" id="number_text" maxlength="6" pattern="\d{6}" value="1234" >
Run Code Online (Sandbox Code Playgroud)
帮助我摆脱这个问题。谢谢
Chrome浏览器自动填充去除的效果background-color
,并background-image
从Username
与Password
输入字段。
自动完成前
自动完成后
但是Chrome 浏览器自动完成功能隐藏了我的输入图标,并且还更改了我的background-color
. 所以我需要我的图标保持原样。
是否可以阻止Chrome 浏览器更改字段的背景颜色并隐藏图像?
.form-section .form-control {
border-radius: 4px;
background-color: #f7f8fa;
border: none;
padding-left: 62px;
height: 51px;
font-size: 16px;
background-repeat: no-repeat;
background-position: left 17px center;
}
.form-section .form-control:focus {
-webkit-box-shadow: none;
box-shadow: none;
}
.form-section .form-group {
margin-bottom: 21px;
}
.form-section .form-control[type="email"] {
background-image: url('https://i.stack.imgur.com/xhx3w.png');
}
.form-section .form-control[type="password"] {
background-image: url('https://i.stack.imgur.com/910l0.png');
}
.form-btn {
padding:10px;
background-color: #65a3fe;
border: none;
color: #ffffff; …
Run Code Online (Sandbox Code Playgroud)每当我在虚线 svg 上应用滚动动画时,它就会转换成一条没有虚线的简单线条。
我想要当前正在运行的相同动画,但行将如下例dashed-line
所示Svg Before animation
。
// Get the id of the <path> element and the length of <path>
var triangle = document.getElementById("dashed-path");
var length = triangle.getTotalLength();
// The start position of the drawing
triangle.style.strokeDasharray = length;
// Hide the triangle by offsetting dash. Remove this line to show the triangle before scroll draw
triangle.style.strokeDashoffset = length;
// Find scroll percentage on scroll (using cross-browser properties), and offset dash same amount as percentage scrolled
window.addEventListener("scroll", myFunction); …
Run Code Online (Sandbox Code Playgroud)是否可以用CSS将背景设置为相同的形状?
带有 css 的预期图像
.cover {
margin: 0;
height: 70vh;
width: 60vw;
background-color: #073faa;
border-radius: 0px 30px 30px 0px;
transform-origin: bottom left;
-ms-transform: skew(-30deg, 0deg);
-webkit-transform: skew(-30deg, 0deg);
transform: skew(-30deg, 0deg);
border-radius:0px 10px 10px 0px
}
Run Code Online (Sandbox Code Playgroud)
<div class="cover"></div>
Run Code Online (Sandbox Code Playgroud)