How can I make a TextArea 100% width without overflowing when padding is present in CSS?

前端 未结 15 2182
失恋的感觉
失恋的感觉 2020-11-29 14:44

I have the following CSS and HTML snippet being rendered.

<
15条回答
  •  孤独总比滥情好
    2020-11-29 14:48

    How about negative margins?

    textarea {
        border:1px solid #999999;
        width:100%;
        margin:5px -4px; /* 4px = border+padding on one side */
        padding:3px;
    }
    

提交回复
热议问题