div 没有显示文本区域 angular+
div doesn't show up with textarea angular+
这是我的 html,我正在使用 angular 但不确定我的错误是否很简单,或者我是否疯了,哈哈。我在文本框周围放了一个 div 并将其定位为 rel,而文本框是 abs,背景应该在 div 中,文本框应该放在它上面。我没有将它直接应用到我尝试过的文本框,但是这对我的文本来说是个问题,文本脱离了彩色背景。
HTML
<div class='email'>
<p> Have Questions?
</p>
<form>
<div class='backg'>
<input placeholder='Name:'>
</div>
<div class='backg'>
<input placeholder='Email:'>
</div>
<div class='mess'>
<textarea class='message' placeholder='Message'>
</textarea>
</div>
</form>
</div>
这是我的scss,不是很好。
我18岁还是初学者,能不能给我一些中肯的建议。
scss
.email {
width:100%;
height:400px;
p {
width:100%;
height: 30px;
font-size: 20px;
}
.backg {
height: 60px;
background-image: url('/assets/images/back.png');
background-size: cover;
background-repeat: no-repeat;
background-position: center;
width: 80%;
input {
width:100%;
height: 100%;
text-indent: 50px;
color: black;
border:none;
background-color: transparent;
font-size:15px;
margin:0px;
padding:0px;
font-weight: 400;
font-family: monospace;
position: absolute;
z-index: +5;
}
}
.mess {
width:40%;
display: flex;
flex-wrap: wrap;
height:150px;
background-image: url('/assets/images/back.png');
background-size: 100% 100%;
background-repeat: no-repeat;
background-position: center;
}
.message {
width:100%;
position: absolute;
z-index: +5;
height:150px;
color: red;
font-size: 20px;
text-indent: 50px;
}
::placeholder {
color: black;
font-weight: 400;
font-size:15px;
font-family: monospace;
}
}
我想通了:背景颜色:透明;显然背景默认是白色的,它覆盖了 div。但为什么 div 不显示它存在?
这是我的 html,我正在使用 angular 但不确定我的错误是否很简单,或者我是否疯了,哈哈。我在文本框周围放了一个 div 并将其定位为 rel,而文本框是 abs,背景应该在 div 中,文本框应该放在它上面。我没有将它直接应用到我尝试过的文本框,但是这对我的文本来说是个问题,文本脱离了彩色背景。
HTML
<div class='email'>
<p> Have Questions?
</p>
<form>
<div class='backg'>
<input placeholder='Name:'>
</div>
<div class='backg'>
<input placeholder='Email:'>
</div>
<div class='mess'>
<textarea class='message' placeholder='Message'>
</textarea>
</div>
</form>
</div>
这是我的scss,不是很好。 我18岁还是初学者,能不能给我一些中肯的建议。
scss
.email {
width:100%;
height:400px;
p {
width:100%;
height: 30px;
font-size: 20px;
}
.backg {
height: 60px;
background-image: url('/assets/images/back.png');
background-size: cover;
background-repeat: no-repeat;
background-position: center;
width: 80%;
input {
width:100%;
height: 100%;
text-indent: 50px;
color: black;
border:none;
background-color: transparent;
font-size:15px;
margin:0px;
padding:0px;
font-weight: 400;
font-family: monospace;
position: absolute;
z-index: +5;
}
}
.mess {
width:40%;
display: flex;
flex-wrap: wrap;
height:150px;
background-image: url('/assets/images/back.png');
background-size: 100% 100%;
background-repeat: no-repeat;
background-position: center;
}
.message {
width:100%;
position: absolute;
z-index: +5;
height:150px;
color: red;
font-size: 20px;
text-indent: 50px;
}
::placeholder {
color: black;
font-weight: 400;
font-size:15px;
font-family: monospace;
}
}
我想通了:背景颜色:透明;显然背景默认是白色的,它覆盖了 div。但为什么 div 不显示它存在?