Html 具有背景图像但没有内容的多个内联容器
我试图支持三个背景图像在css显示内联Html 具有背景图像但没有内容的多个内联容器,html,css,Html,Css,我试图支持三个背景图像在css显示内联 <div id="hd_but2"></div> <div id="hd_div1"></div> <div id="hd_but1"></div> 但是每次我将div改为inline时,它都需要一些内容,比如文本来显示背景图像……如何在不将文本放入容器的情况下做到这一点……有什么更好的方法可以做到这一点呢?使用显示:inline block而不是显示:inline 这里是JSFID
<div id="hd_but2"></div>
<div id="hd_div1"></div>
<div id="hd_but1"></div>
但是每次我将div改为inline时,它都需要一些内容,比如文本来显示背景图像……如何在不将文本放入容器的情况下做到这一点……有什么更好的方法可以做到这一点呢?使用
显示:inline block
而不是显示:inline
这里是JSFIDLE,您可以使用两种方法 表格单元格或内联块 演示是否使用表格单元格 或
或者如果您使用内联块演示您是否尝试过使用
显示:内联块
#hd_but2 {
background-image:url('1.png');
background-repeat:no-repeat;
height:28px;
width:49px;
margin-top:9px;
}
#hd_div1 {
background-image:url('2.png');
background-repeat:no-repeat;
height:46px;
width:4px;
}
#hd_but1 {
background-image:url('3.png');
background-repeat:no-repeat;
height:28px;
width:29px;
margin-top:9px;
}