Actually there is no need to use both the properties together, but as you are using two classes having respective properties is fine, let me explain you here, if you use display: inline;
ONLY, than first you need to see how inline
is it different from float
Inline Elements
Floated Elements
Now, yes, am aware that span
are already inline
elements, but if you see, when I use float
, it makes an inline
element behave like an inline-block
, it applies margins at top
and bottom
as well, while display: inline;
won't.
Another difference is float
is in general different positioning, when you float an element to left or right, it creates an empty space besides, which makes element below it to shift besides that.
Floated Example
While display: inline;
won't
Inline Example
See the difference? So it depends on you what suits best to your needs, just make sure you clear
your floating elements by using overflow: hidden;
or any clearfix available out there else you will see some unexpected behavior of your layout.
Conclusion: Even if you use display: inline;
, your element will be a block
level element and inline
, so there's no need to use display: inline;