Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/72.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
Php 对齐div';它紧挨着彼此_Php_Html_Css_Wordpress_Web - Fatal编程技术网

Php 对齐div';它紧挨着彼此

Php 对齐div';它紧挨着彼此,php,html,css,wordpress,web,Php,Html,Css,Wordpress,Web,正如您可能看到的,我在对齐相邻的4个div时遇到一些问题: 由于某些原因,我无法使它们对齐。 谁能告诉我怎么了 html: 在CSS代码显示内联块的地方,将此规则添加到其中 vertical-align:top; 输出: .frontPost{ width: 250px; display: inline-block; margin-left: 5px; margin-top: 25px; margin-right: 5px; vertical-a

正如您可能看到的,我在对齐相邻的4个div时遇到一些问题:

由于某些原因,我无法使它们对齐。 谁能告诉我怎么了

html:


在CSS代码显示内联块的地方,将此规则添加到其中

vertical-align:top;
输出:

.frontPost{
    width: 250px;
    display: inline-block;
    margin-left: 5px;
    margin-top: 25px;
    margin-right: 5px;
    vertical-align:top;
}
这将使所有div在父div的顶部对齐


一个有用的链接来通读

使用垂直对齐属性怎么样。将下面的代码用于css

.crop {
width: 250px;
height: 150px;
overflow: hidden;
}

.frontPost{
vertical-align:top;
width: 250px;
display: inline-block;
margin-left: 5px;
margin-top: 25px;
margin-right: 5px;
}

.bigTxt{
letter-spacing: 10px;
font-size: 16px;
}

.postTitle{
text-transform: uppercase;
letter-spacing: 1.5px;
font-weight: bold;
}

.postIntro{
text-align: left;
}

希望这对你有所帮助

你能给我一个链接让我看一看吗?你试过打开显示:块而不是内联块吗?Rohil:现在它只是本地的。给frontPost垂直对齐:topWow。。。谢谢你,皮特!我今天一定很累:)
.frontPost{
    width: 250px;
    display: inline-block;
    margin-left: 5px;
    margin-top: 25px;
    margin-right: 5px;
    vertical-align:top;
}
.crop {
width: 250px;
height: 150px;
overflow: hidden;
}

.frontPost{
vertical-align:top;
width: 250px;
display: inline-block;
margin-left: 5px;
margin-top: 25px;
margin-right: 5px;
}

.bigTxt{
letter-spacing: 10px;
font-size: 16px;
}

.postTitle{
text-transform: uppercase;
letter-spacing: 1.5px;
font-weight: bold;
}

.postIntro{
text-align: left;
}