Display div + span on one line?

Failed to display div and range on the same line .. their styles ..

Div

 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;

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;
width: 0px;

DIV, WHICH ARE FORMED IN

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;

What do I need to change to display div and span on the same line? the div is currently being displayed, and then the gap on the line below it.

+3
source share
5 answers

You need to add display:inline;

+8
source

The default “display” value for Div should be a block level element, such as a paragraph that spans the entire “line”.

You need to set the Div to display "display: inline" next to the span element.

+1
source

HTML. , , .

0

, float: left on div .

0

jsFiddle.

CSS.

, .

0

All Articles