How would you get three span's to sit side by side instead of going to the next line without using float in CSS? so I need all three of these to appear next to each other..or if there is another method without using float. THanks!
<span style="display:block; width:33%;">Test1</span>
<span style="display:block; width:33%;">Test2</span>
<span style="display:block; width:33%;">Test2</span>
The most common way to place two divs side by side is by using inline-block css property. The inline-block property on the parent placed the two divs side by side and as this is inline-block the text-align feature worked here just like an inline element does.
Yes. You can have a span within a span .
span won't have padding because it is an inline element by default, so set inline-block or block.
display: inline-block;
or their natural (default) display of inline.. though you can give the inline-block a width and height
Try display: inline-block;
instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With