Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 无法水平对齐div_Css_Html_Web - Fatal编程技术网

Css 无法水平对齐div

Css 无法水平对齐div,css,html,web,Css,Html,Web,我有两个div,我想将它们水平对齐。我正在这样做: CSS: HTML: 发送 几行文字 我需要更改什么?只是缺少垂直对齐:顶部 .horidiv { display: inline-block; width: 20em; height: 20em; border:1px solid #999; vertical-align:top; } (添加到可见性中的边框) <div class="horidiv"> <texta

我有两个div,我想将它们水平对齐。我正在这样做:

CSS:

HTML:




发送 几行文字


我需要更改什么?

只是缺少垂直对齐:顶部

.horidiv {
    display: inline-block;
    width: 20em;
    height: 20em;
    border:1px solid #999;
    vertical-align:top;
}
(添加到可见性中的边框)

<div class="horidiv">
    <textarea></textarea>
    <br>
    <input type="text">
    <br>
    <div id="sendbutton">Send</div>
</div>
<div class="horidiv">
    <iframe width="300" height="225" frameborder="0" style="border:0" src="<gMapsAPI"></iframe>
    <p>Some lines of text</p>
</div>
.horidiv {
    display: inline-block;
    width: 20em;
    height: 20em;
    border:1px solid #999;
    vertical-align:top;
}