當輸入無效時,輸入字段被固定標題隱藏。修改自動滾動<input>必需屬性HTML
是否可以修改或禁用輸入必需屬性的自動滾動?
<!DOCTYPE html>
<html>
<body>
<style>
body {
margin: 0;
}
header {
width: 100%;
height: 50px;
position: fixed;
color: red;
background: #b2b2b2;
opacity: 0.6;
}
form {
padding-top: 65px;
}
</style>
<header>Input Testing</header>
<form action="demo_form.asp">
Username: <input type="text" name="usrname" required>
<p><strong>Note:</strong> The required attribute of the input tag is not supported in Internet Explorer 9 and earlier versions, or in Safari.</p>
<p><strong>Note:</strong> The required attribute of the input tag is not supported in Internet Explorer 9 and earlier versions, or in Safari.</p>
<p><strong>Note:</strong> The required attribute of the input tag is not supported in Internet Explorer 9 and earlier versions, or in Safari.</p>
<p><strong>Note:</strong> The required attribute of the input tag is not supported in Internet Explorer 9 and earlier versions, or in Safari.</p>
<p><strong>Note:</strong> The required attribute of the input tag is not supported in Internet Explorer 9 and earlier versions, or in Safari.</p>
<p><strong>Note:</strong> The required attribute of the input tag is not supported in Internet Explorer 9 and earlier versions, or in Safari.</p>
<p><strong>Note:</strong> The required attribute of the input tag is not supported in Internet Explorer 9 and earlier versions, or in Safari.</p>
<p><strong>Note:</strong> The required attribute of the input tag is not supported in Internet Explorer 9 and earlier versions, or in Safari.</p>
<p><strong>Note:</strong> The required attribute of the input tag is not supported in Internet Explorer 9 and earlier versions, or in Safari.</p>
<input type="submit">
</form>
</body>
</html>
https://jsfiddle.net/0z56f24f/
最好的解決辦法將被附加標題高度的緣至滾動位置正確地顯示它。
[需要HTML5輸入,在提交時滾動輸入固定導航欄](http://stackoverflow.com/questions/19814673/html5-input-required-scroll-to-input-with-fixed-navbar -on-submit) – pdunker