当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - Why is there no space between my URLs when page is loaded with AJAX?

问题描述:

I have the following code for four a elements with Bootstrap's btn class on them.

<a href="{% url 'qna:answer-create-view' object.pk %}" class="btn btn-primary btn-xs">Answer</a>

<a href="#" class="btn btn-default btn-xs"><i class="fa fa-thumbs-o-up"></i> | 0</a>

<a href="#" class="btn btn-default btn-xs"><i class="fa fa-thumbs-o-down"></i> | 0</a>

<a href="#" class="btn btn-default btn-xs">Follow</a>

Normally there was a little space between them when I loaded them as an HTML page. However, I implemented load() function in my JS file and is now loading part of the page containing those elements so that it takes less time to load a new page. But in this method there are no spaces between those elements and it looks aesthetically unpleasant. How can I fix that?

网友答案:

Just add margin to them using CSS

.btn{
   margin: 0 5px;
   display: inline-block;
}
分享给朋友:
您可能感兴趣的文章:
随机阅读: