覆盖默认文本的空白区域

时间:2018-04-23 01:03:22

标签: javascript php html css

在我的textarea中,我在textarea中有一个默认文本。但是,每当我第一次进入页面时,默认文本都会覆盖一层白色。当我进入删除顶部的白色图层时,它会在下面显示我的默认文本。以下是我的代码:

<div class="form-bottom" style="margin-top: 30px">
    <div class="form-group{{ $errors->has('feedbacks') ? ' has-error' : '' }}">
        <div class="col-md-8">
            <textarea id="feedbacks" class="form-control" name="feedbacks"
                      placeholder="Please include a detailed description of your idea and experience"
                      rows="10" style="width: 600px">
            </textarea>
            @if ($errors->has('feedbacks'))
                <span class="help-block">
                    <strong>{{ $errors->first('feedbacks') }}</strong>
                </span>
            @endif
        </div>
    </div>

The picture of my textarea with the white layer on it

The picture of my textarea with the white layer highlighted

The picture of my textarea after I highlight the white area and delete it

1 个答案:

答案 0 :(得分:1)

如评论中所述:您的</textarea>结尾标记在新行中。

您的IDE使用空格或制表符缩进,在textarea的情况下将其视为其内容。

更改

                            <textarea id="feedbacks" class="form-control" name="feedbacks"
                                      placeholder="Please include a detailed description of your idea and experience"
                                      rows="10" style="width: 600px">
                                </textarea>

                            <textarea id="feedbacks" class="form-control" name="feedbacks"
                                      placeholder="Please include a detailed description of your idea and experience"
                                      rows="10" style="width: 600px"></textarea>

你很好(请注意开头标记后的</textarea>结束标记