开发者

CSS alignment textarea a

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜