我想将自定义模态周围的区域(边距)更改为这种颜色 #494c4e54 。如果用户在它关闭的模态之外单击,如果它不会受到影响就太好了
CSS
.mojmodal
{
background: #e2e3e4;
position: absolute;
top:0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
display: none;
width: 350px;
height: 400px;
border-radius: 2px;
border-bottom: 5px solid gray;
}
HTML
<div class="mojmodal gorkaze">
<form name="vnos" method="post">
<div><legend>Prijava</legend>
<label>Uporabniško ime</label><br>
<input type="text" name="ime">
</div>
<div>
<br><label>Geslo</label>
<br><input type="password" name="geslo">
</div>
<div><input type="checkbox" name="zapomni"> Zapomni si me<br><br>
<button type="submit" class="btn btn-primary" name="tipkamodal">Prijava</button></div><div>
<a href="index.php?stran=registracija" style="text-decoration:none;color:gray;">Še nimate računa?</a>
</div></form>
Login();
</div>
没有边距颜色属性。
为了达到这个效果,你需要额外的元素或伪元素。
JD 在此链接上评论了您的问题:https : //developer.mozilla.org/en-US/docs/Web/CSS/ : target#Pure-CSS_lightbox这应该可以帮助您创建效果。
我还建议你复习一下你的 CSS 盒模型:https : //developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Introduction_to_the_CSS_box_model
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句