在同一行显示 Div 跨度?

新手上路,请多包涵

在同一行显示 div 和 span 时遇到问题。它们的样式是……

分区

 color: black;
 display: inline;
 font-family: arial, sans-serif;
 font-size: 13px;
 height: 0px;
 margin-bottom: 0px;
 margin-left: 0px;
 margin-right: 0px;
 margin-top: 0px;
 overflow-y: visible;
 padding-top: 0px;
 white-space: nowrap;
 width: 0px;

跨度

color: black;
display: inline;
font-family: arial, sans-serif;
font-size: 13px;
height: 0px;
margin-bottom: 0px;
margin-left: 0px;
margin-right: 0px;
margin-top: 0px;
overflow-y: visible;
padding-top: 0px;
width: 0px;

两者都包含在其中的 DIV

 color: black;
display: block;
float: left;
font-family: arial, sans-serif;
font-size: 13px;
height: 20px;
margin-bottom: 0px;
margin-left: 8px;
margin-right: 0px;
margin-top: 0px;
overflow-y: visible;
padding-top: 1px;
width: 373px;

我需要更改什么才能使 div 和 span 显示在同一行上?当前显示 div,然后在其下方的行上显示 span。

原文由 Skizit 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 217
1 个回答

您需要添加 display:inline;

原文由 Eddie 发布,翻译遵循 CC BY-SA 3.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题