开发者

CSS alignment textarea a

开发者 https://www.devze.com 2023-02-19 17:32 出处:网络
I\'ve a textarea and a button-stylized link as : __________________ ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯______

I've a textarea and a button-stylized link as :

__________________
|                 |
|                 |
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯  ______
                     |send|
                     ------

I would like horizontal align.

My HTML :

<form method="post" action="">                 开发者_运维知识库 
    <div>
        <textarea></textarea>
        <a href="javascript:void(0);">Send</a>
    </div>
</form>

My CSS :

textarea {
    display: inline;

    border: 1px solid #CCC;
    -webkit-border-radius: 5px;
    -moz-border-radius : 5px;
    border-radius: 5px;
}

form a {
    display: inline-block;
    margin-top: -10px;

    background: #CCC;
    padding: 10px;
    -webkit-border-radius: 5px;
    -moz-border-radius : 5px;
    border-radius: 5px;
}

Sorry for my english.


Why not use a float attribute? For example, in addition to your current CSS styles, append the following styles.

textarea {
  float:left;
}

form a {
  float:left;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消