Why does an inline element take width and height when floated?
Now I have a span element that I give it a width and height, for example 500px I know its an inline element, so it doesn't accept width and height, but why is it applied when I float?
span.first {
width: 500px;
height: 500px;
border: 1px solid #000;
float: right;
}
span.second {
width: 500px;
height: 500px;
border: 1px solid #000;
}
<span class="first">with float</span>
<span class="second">without float</span>
+3
source to share