我有一个顶层导航栏,但目前登录用户名,日期和时间和搜索之间有许多空间如下:

但是有没有一种方法可以最小化组件之间的间距,如下所示:

我当前顶部导航的html是:-
<section id="login" class="navbar-search pull-right">
<span class="username" style=" display:block;"><i class="icon-user"></i><strong> @User.Identity.Name.Substring(User.Identity.Name.IndexOf("\\") + 1)</strong></span>
<div style="text-align:right">
<p id="currentdate"></p>
<p id="currenttime" ></p>
</div>
<form class="customSearch" method="GET" action="@Url.Action("Search", "Home")">
<input class="searchInput" placeholder="Search" name="searchTerm2" data-autocomplete-source= "@Url.Action("AutoComplete", "Home")" type="text" />
</form>
</section>发布于 2013-11-11 21:50:16
我建议你使用Chrome浏览器来检查元素,看看你的CSS中哪里出了问题,简单方便,我一直都在这么做。
发布于 2013-11-11 21:57:18
在css中使用行高、边距或填充属性。
https://stackoverflow.com/questions/19907808
复制相似问题