2016-12-01 168 views
0

我正試圖減少照片下面一排名稱中的單元格之間的空間。我嘗試了所有我能找到的東西,但沒有運氣。任何人都可以告訴我如何讓這些名字靠近桌子嗎?我做了一個小提琴here。我使用的引導3.感謝如何減少表格單元之間的空間?

在HTML

<div class="container"> 

    <div class="col-xs-12 col-md-6 col-sm-8 col-lg-6 center-block animated fadeInUp"> 

    <div class="results"> 
     <ul id="results"> 
     <!-- results appear here --> 
     <h3> 
Image title 
</h3> 
     <div class="dark"> 
      <a href="page.php?page_id=241"><img src="http://www.fiji.travel/sites/default/files//styles/views-large-thumbnail/public/arial-of-island.jpg?itok=KZHGX6pJ" width="600" class="img-responsive" alt=""></a> 
     </div> 





     <small>posted by: 

             <a href="profile.php?user_id=user_id" span="" class=""> 
               Anderson</a></small> 

<!-Make These names sit closer together---> 
     <table id="myTable2" border="0" cellpadding="0" cellspacing="0" class="table" style="width:auto;"> 
      <tbody> 

      <tr style="\&quot;display:none;\&quot;"> 
       <td valign="top"><strong><a href="profile.php?user_id=6" class="tags" style="color:"> 
               Anderson,</a>&nbsp;</strong></td> 
       <td valign="top"><strong><a href="profile.php?user_id=9" class="tags" style="color:#3cb0fd"> 
               James Bond,</a>&nbsp;</strong></td> 
       <td valign="top"><strong><a href="profile.php?user_id=2" class="tags" style="color:"> 
               Julian,</a>&nbsp;</strong></td> 
      </tr> 
      </tbody> 
     </table> 
     <hr> 

回答

0

你需要一個CSS復位腳本。每當你建立一個新的網站時,把它作爲最頂層的CSS腳本。它會在所有元素上設置填充和邊距爲零。在表單元格上,默認填充通常爲2px。

還有其他的,但這不是一個糟糕的開始。從http://meyerweb.com/eric/tools/css/reset/

/* http://meyerweb.com/eric/tools/css/reset/ 
    v2.0 | 20110126 
    License: none (public domain) 
*/ 

html, body, div, span, applet, object, iframe, 
h1, h2, h3, h4, h5, h6, p, blockquote, pre, 
a, abbr, acronym, address, big, cite, code, 
del, dfn, em, img, ins, kbd, q, s, samp, 
small, strike, strong, sub, sup, tt, var, 
b, u, i, center, 
dl, dt, dd, ol, ul, li, 
fieldset, form, label, legend, 
table, caption, tbody, tfoot, thead, tr, th, td, 
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary, 
time, mark, audio, video { 
    margin: 0; 
    padding: 0; 
    border: 0; 
    font-size: 100%; 
    font: inherit; 
    vertical-align: baseline; 
} 
/* HTML5 display-role reset for older browsers */ 
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section { 
    display: block; 
} 
body { 
    line-height: 1; 
} 
ol, ul { 
    list-style: none; 
} 
blockquote, q { 
    quotes: none; 
} 
blockquote:before, blockquote:after, 
q:before, q:after { 
    content: ''; 
    content: none; 
} 
table { 
    border-collapse: collapse; 
    border-spacing: 0; 
} 
2

添加到您的CSS:

#myTable2 td { 
    padding: 0 0; 
} 

它會刪除你想擺脫的填充,細胞會緊挨着對方。

+0

這對我所做的小提琴完美工作,但不在我的網頁上(whoch使用引導模板)。 – JulianJ

相關問題