Html 如何在bootstrap 4中的图像上写入文本

Html 如何在bootstrap 4中的图像上写入文本,html,image,bootstrap-4,Html,Image,Bootstrap 4,我想在bootstrap 4中的图像上添加文本,但当我添加文本时,它将显示在图像之后,如下所示: 以下是我目前的代码: 身体{ 框大小:边框框;边距:0px;填充:0px;溢出-x:隐藏; } .行>*{最小高度:80px; } .img液{ 宽度:100%; 高度:400px; } FSDFDSFDS 试试这个,你就完成了。。。 只需在下面添加css h1 { position: absolute; left: 0; top: 0; right: 0;

我想在bootstrap 4中的图像上添加文本,但当我添加文本时,它将显示在图像之后,如下所示:

以下是我目前的代码:


身体{
框大小:边框框;边距:0px;填充:0px;溢出-x:隐藏;
}
.行>*{最小高度:80px;
}
.img液{
宽度:100%;
高度:400px;
}
FSDFDSFDS

试试这个,你就完成了。。。 只需在下面添加css

h1 {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    width: max-content;
    height: max-content;
    background:#FFF;
}
h1{
位置:绝对位置;
左:0;
排名:0;
右:0;
底部:0;
保证金:自动;
宽度:最大含量;
高度:最大含量;
背景:#FFF;
}

身体{
框大小:边框框;边距:0px;填充:0px;溢出-x:隐藏;
}
.行>*{最小高度:80px;
}
.img液{
宽度:100%;
高度:400px;
}
FSDFDSFDS

试试这个,你就完成了。。。 只需在下面添加css

h1 {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    width: max-content;
    height: max-content;
    background:#FFF;
}
h1{
位置:绝对位置;
左:0;
排名:0;
右:0;
底部:0;
保证金:自动;
宽度:最大含量;
高度:最大含量;
背景:#FFF;
}

身体{
框大小:边框框;边距:0px;填充:0px;溢出-x:隐藏;
}
.行>*{最小高度:80px;
}
.img液{
宽度:100%;
高度:400px;
}
FSDFDSFDS