对于我的网站我试图将两个td拉近。他们是相距甚远的,我一直试图把数字和td与图像放在一起。这是我的网站的域名: 如果你检查代码,你会发现它很可怕,这可能就是为什么我很难把两个td拉得更近。
更清楚的是,我要做的是
<table>
<td class="vert-align" style="padding:0;" >
<div class="votes">
<a href="/post/{{ post.slug }}/vote?is_up=1" class="vote">
<span class="glyphicon glyphicon-triangle-top col-md-12" aria-hidden="true"></span></a>
<br />
<span class="col-md-12" style="height:1px; font-family: 'Passion One', cursive; bottom:10px; padding-left:0.01em;
#and
<td class="vert-align">
{% if post.main_image %}
<h4 id="lineForUrl">
<a href="{{ post.url }}" target="_blank" style="margin-left: 15px; text-decoration:none;"> <img src="{{post.get_image_url}}" class="img-rounded" alt="Cinque Terre" height="75" width="75"/><span id="title-font" title="{{post.title}}">
{{ post.title }}</span><span style="margin-left: 15px;" class="domain">({{ post.domain }})</span></a>
<span class="discuss" style="color:red;"><a href="{% url 'post' post.slug %}" class="btn btn-warning btn-sm">enter</a></span>
<br />
<span class="post-info">
{% if user.is_authenticated %}
<a href="{% url 'userena_profile_detail' post.moderator.user %}">{{ post.moderator.user }}</a>wrote
{% else %}
{{ post.moderator.user }}wrote
{% endif %}
<a href="/category/{{post.category}}">#{{post.category}}</a></span>
</h4>
"><h4 id="vote_count_{{ post.slug }}">{{ post.get_vote_count }}</h4></span> <br>
<a href="/post/{{ post.slug }}/vote?is_up=0" class="vote">
<span class="glyphicon glyphicon-triangle-bottom col-md-12" aria-hidden="true"></span></a>
</div>
</td>
</table>
#closer
答案 0 :(得分:1)
尝试使用此CSS行(如果我已正确理解您的问题)
#cell td.vert-align:first-child { width: 40px;}
它会使您的td
显示数字,td
显示图片更近