为什么这两个DIV不显示内联?任何事情发生,第二个DIV显示底部...
#mac{
display: inline-block;
background-color:#000000;
background-repeat: no-repeat;
padding-top:130px;
height:455px;
width:50%;
}
#mac2{
display: inline-block;
background-color:#000000;
background-repeat: no-repeat;
padding-top:130px;
height:455px;
width:50%;
}
<!doctype html>
<html>
<head></head>
<body>
<div id="mac"></div><div id="mac2"><img src="images/rocket.png"><span class="textomedio">Maximizamos tu ROI</span></div>
</body>
</html>
答案 0 :(得分:0)
您需要将vertical-align:top;
添加到#mac2
:
#mac{
display: inline-block;
background-color:#000000;
background-repeat: no-repeat;
padding-top:130px;
height:455px;
width:50%;
}
#mac2{
display: inline-block;
background-color:#000000;
background-repeat: no-repeat;
padding-top:130px;
height:455px;
width:50%;
vertical-align:top;
}
&#13;
<!doctype html>
<html>
<head></head>
<body>
<div id="mac"></div><div id="mac2"><img src="images/rocket.png"><span class="textomedio">Maximizamos tu ROI</span></div>
</body>
</html>
&#13;