Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/37.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
Html css垂直对齐中间不';行不通_Html_Css_Vertical Alignment - Fatal编程技术网

Html css垂直对齐中间不';行不通

Html css垂直对齐中间不';行不通,html,css,vertical-alignment,Html,Css,Vertical Alignment,.parent{ 高度:50px; 背景:金; } .check a、.radio a、.selecta{ 显示:内联块; 垂直对齐:中间对齐; } 洛勒姆 洛勒姆 为了更好地使用,请向您的家长添加以下内容: .parent{ height:50px; background:gold; display: flex; align-items: center; } 您可以删除以下样式:.checka、.radioa、.selecta您还可以添加行高以使其居中。只需确保高度和行高度相等即可。有关该

.parent{
高度:50px;
背景:金;
}
.check a、.radio a、.selecta{
显示:内联块;
垂直对齐:中间对齐;
}

洛勒姆
洛勒姆
为了更好地使用,请向您的家长添加以下内容:

.parent{
height:50px;
background:gold;
display: flex;
align-items: center;
}

您可以删除以下样式:.checka、.radioa、.selecta

您还可以添加
行高以使其居中。只需确保
高度
行高度
相等即可。有关该效果的另一个动态示例,请参见

.parent{
高度:50px;
线高:50px;
背景:金;
}
.check a、.radio a、.selecta{
显示:内联块;
}

洛勒姆
洛勒姆

因为你没有给他们一个高度?@j08691我们不需要高度,垂直对齐工作与线框(没有人能看到)而不是包含块(每个人都能看到)。。。这将总是混淆IEN11中的每一项工作?我们仍然需要<代码>垂直对齐:中间< /代码>……增加行高将增加行框并保持对齐在中间如预期…事实上,它们并不在中间。