除了Safari之外,我的表单边框在所有浏览器上都显示效果很好。有时它们根本不显示,有时会缺少一条边。任何帮助都是极好的。您可以到这里查看http://cmweb.design
这是html
<section id="contact">
<article>
<h2 class="title1">Start Your Project</h2>
<p>Reach out to see if we are the right fit for your project. We'd love to help see a vision come to reality.</p>
<form method="POST" action="mail.php">
<aside id="inputs">
<input type="text" name="firstname" value="First Name" required><br>
<input type="text" name="lastname" value="Last Name" required><br>
<input type="email" name="email" value="Email" required><br>
</aside>
<textarea name="comments">Enter message here...</textarea>
<button type="submit" value="Send">Submit</button>
</form>
</article>
</section>
这是css:
*--- Contact ---*/
#contact{
background-color: #181818;
display: table;
text-align: center;
width: 100%;
}
#contact article{
display: table-cell;
padding: 100px;
vertical-align: middle;
}
#contact h2{
color: white;
padding-bottom: 20px;
}
#contact p{
font-size: 14px;
margin: 0 auto;
padding-bottom: 40px;
width: 50%;
}
form{
font-family: 'Raleway', sans-serif;
-webkit-appearance: none;
}
#inputs{
display: inline-block;
}
input{
background-color: #181818;
border-color: #cfcfcf;
border-width: 0px 0px .5px 0px;
border-radius: 0;
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-style: solid;
color: #cfcfcf;;
display: inline-block;
font-family: 'Raleway', sans-serif;
font-size: 15px;
height: 25px;
margin-right: 20px;
margin-top: 21px;
text-transform: uppercase;
-webkit-appearance: none;
width: 240px;
}
textarea{
background-color: #181818;
border-color: #cfcfcf;
border-width: .5px;
border-style: solid;
border-radius: 0;
-moz-border-radius: 0;
-webkit-border-radius: 0;
color: #cfcfcf;
display: inline-block;
font-family: 'Raleway', sans-serif;
font-size: 15px;
height: 120px;
line-height: 25px;
min-width: 305px;
margin-top: 20px;
padding: 5px 10px;
text-transform: uppercase;
width: 10%;
-webkit-appearance: none;
vertical-align: top;
}
button{
background: none;
border: .5px solid #cfcfcf;
border-radius: 0;
-moz-border-radius: 0;
-webkit-border-radius: 0;
color: white;
display: inline-block;
font-family: 'Raleway', sans-serif;
font-size: 15px;
margin-left: 20px;
margin-top: 20px;
padding: 50px 40px;
position: relative;
text-transform: uppercase;
vertical-align: top;
}
button::after{
border-top: 70px solid rgba(101,70,84,0.5);
content: "";
top: 25px; right: 0;left: 0;
position: absolute;
-webkit-transition: all .4s ease;
-moz-transition: all .4s ease;
-ms-transition: all .4s ease;
-o-transition: all .4s ease;
transition: all .4s ease;
}
button:hover::after{
border-top: 70px solid rgba(227,228,217,0.5);
content: "";
top: 25px; right: 0; left: 0;
position: absolute;
}
答案 0 :(得分:0)
将边框宽度0.5
更改为1
没有半像素这样的单位:)
最小值为1px,显然有些浏览器将其四舍五入为1,其他浏览器则向下舍入为0px。
input{
background-color: #181818;
border-color: #cfcfcf;
border-width: 0px 0px 1px 0px;
border-radius: 0;
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-style: solid;
color: #cfcfcf;;
display: inline-block;
font-family: 'Raleway', sans-serif;
font-size: 15px;
height: 25px;
margin-right: 20px;
margin-top: 21px;
text-transform: uppercase;
-webkit-appearance: none;
width: 240px;
}
textarea{
background-color: #181818;
border-color: #cfcfcf;
border-width: 1px;
border-style: solid;
border-radius: 0;
-moz-border-radius: 0;
-webkit-border-radius: 0;
color: #cfcfcf;
display: inline-block;
font-family: 'Raleway', sans-serif;
font-size: 15px;
height: 120px;
line-height: 25px;
min-width: 305px;
margin-top: 20px;
padding: 5px 10px;
text-transform: uppercase;
width: 10%;
-webkit-appearance: none;
vertical-align: top;
}