float puts submit button outside of div

后端 未结 5 1818
天涯浪人
天涯浪人 2021-01-02 08:34

I am having some trouble with my css, I have a content id and then inside that I have a class that is just padding. When inside the padding class, I have a textarea and a su

5条回答
  •  醉梦人生
    2021-01-02 09:28

    The problem arises because you do not have a static height set for #content. If you set a static height for content ( padding + textArea + submitButton ) and set that as the height for #content, then it will look allow the room for everything.

    #content {
    width: 60%;
    background: #ffffdffffd;
    color: #000;
    margin: 0 auto;
    border-radius: 4px;
    margin-bottom: 10px;
    height: 140px; //Play with this number to get it perfect.
    

    }

提交回复
热议问题