Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.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 如何使绝对定位的元素与另一个元素具有相同的大小_Html_Css_Twitter Bootstrap - Fatal编程技术网

Html 如何使绝对定位的元素与另一个元素具有相同的大小

Html 如何使绝对定位的元素与另一个元素具有相同的大小,html,css,twitter-bootstrap,Html,Css,Twitter Bootstrap,我有一个这样的布局: 正文{ 文本对齐:居中; } .链接{ 位置:相对位置; } .info{ 显示器:flex; 弯曲方向:立柱; 证明内容:中心; 对齐项目:居中; 位置:绝对位置; 排名:0; 文本对齐:居中; 宽度:100%; 身高:100%; 背景色:#263238; 颜色:#1DE9B6; 不透明度:0; 可见性:隐藏; } .link:hover.info{ 不透明度:1; 能见度:可见; } .col-md-3{ 边缘底部:30px; } 信息 信息 信息 信息 信息 信息

我有一个这样的布局:

正文{
文本对齐:居中;
}
.链接{
位置:相对位置;
}
.info{
显示器:flex;
弯曲方向:立柱;
证明内容:中心;
对齐项目:居中;
位置:绝对位置;
排名:0;
文本对齐:居中;
宽度:100%;
身高:100%;
背景色:#263238;
颜色:#1DE9B6;
不透明度:0;
可见性:隐藏;
}
.link:hover.info{
不透明度:1;
能见度:可见;
}
.col-md-3{
边缘底部:30px;
}

信息
信息
信息
信息
信息
信息
信息
信息

只需将display:inline块添加到link元素中即可

.link {
  position: relative;
  display: inline-block;
}
或者也可以在.link元素上添加
d-inline-block-position relative

正文{
文本对齐:居中;
}
.链接{
位置:相对位置;
显示:内联块;
}
.info{
显示器:flex;
弯曲方向:立柱;
证明内容:中心;
对齐项目:居中;
位置:绝对位置;
排名:0;
文本对齐:居中;
宽度:100%;
身高:100%;
背景色:#263238;
颜色:#1DE9B6;
不透明度:0;
可见性:隐藏;
}
.link:hover.info{
不透明度:1;
能见度:可见;
}
.col-md-3{
边缘底部:30px;
}

信息
信息
信息
信息
信息
信息
信息
信息