【问题标题】:div doesn't show up with textarea angular+div 不显示 textarea 角度
【发布时间】:2018-09-03 06:13:39
【问题描述】:

这是我的 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;
    }
 }

【问题讨论】:

    标签: html angular textarea


    【解决方案1】:

    我想通了:背景色:透明;显然背景默认是白色的,它覆盖了 div。但是为什么 div 不显示它存在呢?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-08-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多