【发布时间】:2019-09-27 16:01:03
【问题描述】:
我的信封联系表有问题。它在桌面上工作得很好,但在使其响应时出现问题。现在似乎有一个溢出问题。我相信这与在 px 中使用宽度和高度尺寸有关。我一直在尝试在 % 中制作宽度和高度,并且还溢出:隐藏;但没有运气。如何使我的代码具有响应性,使其在移动设备和平板电脑上也能正常工作?
body,
div,
h1,
h2,
form,
fieldset,
input,
textarea,
footer,
p {
margin: 0;
padding: 0;
border: 0;
outline: none;
}
.turbotobias-contact-section-wrapper {
background-color: #ffffff;
color: #000000;
font-family: open sans, Arial, sans-serif;
height: 60vh;
display: flex;
}
.turbotobias-contact-section-wrapper p {
font-size: 24px;
}
#wrap {
width: 530px;
margin: 20px auto 0;
height: 1000px;
}
h1 {
margin-bottom: 20px;
text-align: center;
font-size: 35px;
font-family: open sans, Arial, sans-serif;
color: white;
}
#form-wrap {
overflow: hideen;
height: 447px;
position: relative;
top: 0px;
transition: all 1s ease-in-out 0.3s;
}
#form-wrap:before {
content: "";
position: absolute;
bottom: 128px;
left: 0px;
background: url(https://www.onlinefox.dk/wp-content/uploads/2019/09/brev-before.png) !important;
width: 530px;
height: 317px;
}
#form-wrap:after {
content: "";
position: absolute;
bottom: 0px;
left: 0;
background: url(https://www.onlinefox.dk/wp-content/uploads/2019/09/brev-after.png) !important;
width: 530px;
height: 259px;
z-index: 999;
}
#form-wrap.hide:after,
#form-wrap.hide:before {
display: none;
}
#form-wrap:hover {
height: 777px;
top: -200px;
}
form {
background: white;
position: relative;
top: 200px;
overflow: hidden;
height: 200px;
width: 400px;
margin: 0px auto !important;
padding: 20px !important;
border: 1px solid white;
border-right: 3px;
transition: all 1s ease-in-out 0.3s;
}
#form-wrap:hover form {
height: 530px;
}
label {
margin: 11px 20px 0 0;
font-size: 15px;
color: gray;
text-transform: uppercase;
}
input[type="text"],
textarea {
font: 14px normal uppercase, arial, serif;
color: dimgray;
background: none;
width: 380px;
height: 37px;
padding: 0px 10px;
margin: 0 0 10px 0;
border: 1px solid #f8f5f1;
border-radius: 5px;
}
textarea {
height: 80px;
padding-top: 14px;
}
textarea:focus,
input[type="text"]:focus {
background: white;
}
#form-wrap input[type="submit"] {
position: relative;
font-family: open sans, Arial, sans-serif;
font-size: 24px;
color: gray;
width: 100%;
text-align: center;
opacity: 0;
background: none;
cursor: pointer;
border-radius: 3px;
border: none !important;
transition: opacity 0.7s ease-in-out 0s;
}
#form-wrap:hover input[type="submit"] {
z-index: 1;
opacity: 1;
transition: opacity 0.5s ease-in-out 1.3s;
}
.turbotobias-contact-row {
display: flex;
width: 80%;
max-width: 1080px;
margin: auto;
padding-bottom: 50px;
flex-direction: row;
flex-wrap: wrap;
}
@media (max-width: 980px) {
.turbotobias-contact-row {
padding: 30px 0;
}
}
<div class='turbotobias-contact-section-wrapper'>
<div class='turbotobias-contact-row'>
<div id="wrap">
<br><br><br>
<div id="form-wrap">
<form>
<p>HEJ TURBOTOBIAS,</p>
<label for="email">Din besked:</label>
<textarea name="message" id="message" value="Your message"></textarea>
<p>VENLIG HILSEN,</p>
<label for="name">Navn:</label>
<input type="text" name="name" value="" id="">
<label for="email">Email:</label>
<input type="text" name="email" value="" id="email">
<input type="submit" name="submit" value="SEND MIN BESKED TAK!">
</form>
</div>
</div>
</div>
</div>
【问题讨论】:
标签: html css responsive-design media-queries overflow