How to add distance between two span elements

I have two span elements. I want them to sit side by side and contain some kind of text. Is it possible? If so, what am I doing wrong?


.added-box{
 background-color:#06C;
 padding:8px;
 margin:8px;
}

.edited-box{
 background-color:#093;
 padding:8px;
 margin:8px;

}

And page code:

<p align="right">
   <span class="edited-box">sfds<span>
   <span class="added-box">sfds<span>
</p>

Edit: what I hope to receive is a box similar to the one on this page that has my name, the time I asked the question and my questions. I don't mind how I understand this, but css is preferable, it looks like StackOverflow is using a table. Is this the only way to do this?

+3
source share
2 answers

You have two typos in your HTML where you cannot close tags <span>with </span>. It should be:

<p align="right">
  <span class="edited-box">sfds</span>
  <span class="added-box">sfds</span>
</p>

edited-box , , CSS .

+8

&nbsp; .

-4

Source: https://habr.com/ru/post/1765599/


All Articles