鍍金池/ 問(wèn)答/HTML/ 邊框渲染異常

邊框渲染異常

如圖所示,第一次進(jìn)入這個(gè)頁(yè)面,textarea的左邊框跑到上面的label那里去了。
clipboard.png
如果選擇定時(shí)發(fā)布彈出時(shí)間輸入框,也就是UI重繪一下,就正常了
clipboard.png

這個(gè)問(wèn)題反復(fù)出現(xiàn),搞不清楚是什么原因?qū)е碌?,textarea的寬度也并沒(méi)有超出,而且也用了box-sizing:border-box;

.form-group{
    position: relative;
    width: 34.2rem;
    margin: 0 auto;
}
.form-group>textarea{
    display:block;
    width: 100%;
    height: 5.35rem;
    border: 1px solid #ccc;
    margin: 0;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    font-size: .8rem;
    resize:none;
    outline: none;
}

回答
編輯回答
柒槿年
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<style>
    textarea{
        display:block;
        width: 100%;
        height: 5.35rem;
        border: 1px solid #ccc;
        margin: 0;
        -webkit-box-sizing: border-box;
        box-sizing: border-box;
        font-size: .8rem;
        resize:none;
        outline: none;
    }
</style>
<body>
    <textarea name="">
        

    </textarea>
    
</body>
</html>

一切正常的,換個(gè)環(huán)境測(cè)試呢?

2018年5月9日 14:42