在同一行显示 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 许可协议
您需要添加
display:inline;