开发者

How to reduce blank space in html? [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 11 years ago.

My desired output is:

How to reduce blank space in html? [closed]

My de facto output has too much blank space:

How to reduce blank space in html? [closed]

The code is:

<div id="tabarea"><ul id="tabnav"><li class="tab_all"><strong>All</strong></li><li class="tab_private"><a title="Display only info from privates" href="?t=&f=p" >Private<span class="tab_right_links"></span></a></li><li class="tab_company"><a title="Show only info from companies" href="?t=&f=c" >Company<span class="tab_right_links"></span></a></li></ul></div><table><tr><td><table class="listingWithImages" border="0px"><tr><td>4 hours, 3 minutes</td><td><img src="http://localhost:8080/_ah/img/8oUwXdeweiQmEq_ESy33RQ===s100"></td><td><a href="/servead/105">Test2</a><br/></td><td><span id="ahFjbGFzc2lmaWVkc21hcmtldHIICxICQWQYaQw" style="margin:0; padding:0 display:inline">Sweden</span></td><td></td></tr><tr><td>4 hours, 14 minutes</td><td><img src="http://localhost:8080/_ah/img/HmoH2SsmUcoPOKiJZM-gVw===s100"></td><td><a href="/servead/102">Test</a><br/></td><td><span id="ahFjbGFzc2lmaWVkc21hcmtldHIICxICQWQYZgw" style="margin:0; padding:0 display:inline">Sweden</span></td><td></td></tr><tr><td>4 hours, 15 minutes</td><td><img src="http://localhost:8080/_ah/img/zrBsUrSO6T_g48xvf_3GDQ===s100"></td><td><a href="/servead/100">Test</a><br/></td><td><span id="ahFjbGFzc2lmaWVkc21hcmtldHIICxICQWQYZAw" style="margin:0; padding:0 display:inline">Sweden</span></td><td></td></tr><tr><td>4 hours, 16 minutes</td>&l开发者_如何学JAVAt;td><img src="http://localhost:8080/_ah/img/mTQP6dGy9OJqChqujxL6PA===s100"></td><td><a href="/servead/98">Test</a><br/></td><td><span id="ahFjbGFzc2lmaWVkc21hcmtldHIICxICQWQYYgw" style="margin:0; padding:0 display:inline">Sweden</span></td><td></td></tr><tr><td>4 hours, 17 minutes</td><td><img src="http://localhost:8080/_ah/img/KVMHyBo32fWE_ruH8a7zjQ===s100"></td><td><a href="/servead/96">Test</a><br/></td><td><span id="ahFjbGFzc2lmaWVkc21hcmtldHIICxICQWQYYAw" style="margin:0; padding:0 display:inline">Sweden</span></td><td></td></tr><tr><td>4 hours, 19 minutes</td><td></td><td><a href="/94/test">Test</a><br/></td><td><span id="ahFjbGFzc2lmaWVkc21hcmtldHIICxICQWQYXgw" style="margin:0; padding:0 display:inline">Sweden</span></td><td></td></tr><tr><td>4 hours, 22 minutes</td><td><img src="/images/93.png" alt="Test"/></td><td><a href="/90/test">Test</a><br/></td><td><span id="ahFjbGFzc2lmaWVkc21hcmtldHIICxICQWQYWgw" style="margin:0; padding:0 display:inline">Sweden</span></td><td></td></tr><tr><td>4 days, 15 hours</td><td></td><td><a href="/72/computer-services">Computer services</a><br/></td><td><span id="ahFjbGFzc2lmaWVkc21hcmtldHIICxICQWQYSAw" style="margin:0; padding:0 display:inline">Sweden</span></td><td></td></tr><tr><td>4 days, 22 hours</td><td></td><td><a href="/68/test">Test</a><br/>

EUR&nbsp;220
</td><td><span id="ahFjbGFzc2lmaWVkc21hcmtldHIICxICQWQYRAw" style="margin:0; padding:0 display:inline">Sweden</span></td><td></td></tr><tr><td>4 days, 22 hours</td><td></td><td><a href="/67/test">Test</a><br/>
EUR&nbsp;220
</td><td><span id="ahFjbGFzc2lmaWVkc21hcmtldHIICxICQWQYQww" style="margin:0; padding:0 display:inline">Sweden</span></td><td></td></tr><tr><td>4 days, 22 hours</td><td></td><td><a href="/64/test">Test</a><br/>
EUR&nbsp;220
</td><td><span id="ahFjbGFzc2lmaWVkc21hcmtldHIICxICQWQYQAw" style="margin:0; padding:0 display:inline">Sweden</span></td><td></td></tr><tr><td>5 days, 17 hours</td><td></td><td><a href="/63/computer-services">Computer services</a><br/>

EUR&nbsp;220
</td><td><span id="ahFjbGFzc2lmaWVkc21hcmtldHIICxICQWQYPww" style="margin:0; padding:0 display:inline">Sweden</span></td><td></td></tr><tr><td>5 days, 18 hours</td><td></td><td><a href="/57/computer-services">Computer services</a><br/>
EUR&nbsp;220
</td><td><span id="ahFjbGFzc2lmaWVkc21hcmtldHIICxICQWQYOQw" style="margin:0; padding:0 display:inline">Sweden</span></td><td></td></tr><tr><td>5 days, 20 hours</td><td></td><td><a href="/52/computer-services">Computer services</a><br/>
EUR&nbsp;220
</td><td><span id="ahFjbGFzc2lmaWVkc21hcmtldHIICxICQWQYNAw" style="margin:0; padding:0 display:inline">Sweden</span></td><td></td></tr><tr><td>5 days, 21 hours</td><td><img src="http://localhost:8080/_ah/img/hFT-PUQJfOX1jh_P5Zl80A===s100"></td><td><a href="/servead/50">Computer services</a><br/>

EUR&nbsp;220
</td><td><span id="ahFjbGFzc2lmaWVkc21hcmtldHIICxICQWQYMgw" style="margin:0; padding:0 display:inline"></span></td><td></td></tr><tr><td>5 days, 22 hours</td><td><img src="http://localhost:8080/_ah/img/SnoEEZiYDBbWNauTqvKhTg===s100"></td><td><a href="/servead/46">Computer services</a><br/>
EUR&nbsp;220
</td><td><span id="ahFjbGFzc2lmaWVkc21hcmtldHIICxICQWQYLgw" style="margin:0; padding:0 display:inline"></span></td><td></td></tr><tr><td>5 days, 22 hours</td><td></td><td><a href="/42/computer-services">Computer services</a><br/>
EUR&nbsp;220
</td><td><span id="ahFjbGFzc2lmaWVkc21hcmtldHIICxICQWQYKgw" style="margin:0; padding:0 display:inline">Sweden</span></td><td></td></tr><tr><td>5 days, 22 hours</td><td></td><td><a href="/40/computer-services">Computer services</a><br/>
EUR&nbsp;220

</td><td><span id="ahFjbGFzc2lmaWVkc21hcmtldHIICxICQWQYKAw" style="margin:0; padding:0 display:inline">Sweden</span></td><td></td></tr><tr><td>5 days, 22 hours</td><td></td><td><a href="/39/frankwin-international-educatoin-and-immigration">Frankwin International, Educatoin and Immigration</a><br/>
EUR&nbsp;220
</td><td><span id="ahFjbGFzc2lmaWVkc21hcmtldHIICxICQWQYJww" style="margin:0; padding:0 display:inline">Sweden</span></td><td></td></tr><tr><td>5 days, 22 hours</td><td></td><td><a href="/36/computer-services">Computer services</a><br/>
EUR&nbsp;220
</td><td><span id="ahFjbGFzc2lmaWVkc21hcmtldHIICxICQWQYJAw" style="margin:0; padding:0 display:inline">Sweden</span></td><td></td></tr><tr><td>6 days, 2 hours</td><td></td><td><a href="/34/"></a><br/></td><td><span id="ahFjbGFzc2lmaWVkc21hcmtldHIICxICQWQYIgw" style="margin:0; padding:0 display:inline">Sweden</span></td><td></td></tr><tr><td>6 days, 3 hours</td><td></td><td><a href="/33/"></a><br/></td><td><span id="ahFjbGFzc2lmaWVkc21hcmtldHIICxICQWQYIQw" style="margin:0; padding:0 display:inline">Sweden</span></td><td></td></tr><tr><td>6 days, 3 hours</td><td></td><td><a href="/29/computer-services">Computer services</a><br/></td><td><span id="ahFjbGFzc2lmaWVkc21hcmtldHIICxICQWQYHQw" style="margin:0; padding:0 display:inline">Sweden</span></td><td></td></tr><tr><td>6 days, 3 hours</td><td></td><td><a href="/28/computer-services">Computer services</a><br/></td><td><span id="ahFjbGFzc2lmaWVkc21hcmtldHIICxICQWQYHAw" style="margin:0; padding:0 display:inline">Sweden</span></td><td></td></tr><tr><td>6 days, 3 hours</td><td></td><td><a href="/25/computer-services">Computer services</a><br/></td><td><span id="ahFjbGFzc2lmaWVkc21hcmtldHIICxICQWQYGQw" style="margin:0; padding:0 display:inline">Sweden</span></td><td></td></tr><tr><td>1 week</td><td></td><td><a href="/22/test">Test</a><br/></td><td><span id="ahFjbGFzc2lmaWVkc21hcmtldHIICxICQWQYFgw" style="margin:0; padding:0 display:inline">Sweden</span></td><td></td></tr><tr><td>1 week</td><td></td><td><a href="/21/"></a><br/></td><td><span id="ahFjbGFzc2lmaWVkc21hcmtldHIICxICQWQYFQw" style="margin:0; padding:0 display:inline">Sweden</span></td><td></td></tr><tr><td>1 week</td><td></td><td><a href="/18/"></a><br/></td><td><span id="ahFjbGFzc2lmaWVkc21hcmtldHIICxICQWQYEgw" style="margin:0; padding:0 display:inline">Sweden</span></td><td></td></tr><tr><td>1 week, 6 days</td><td><img src="/images/6.png" alt="Computer ..."/></td><td><a href="/3/computer-services">Computer services</a><br/>

EUR&nbsp;220
</td><td><span id="ahFjbGFzc2lmaWVkc21hcmtldHIICxICQWQYAww" style="margin:0; padding:0 display:inline">Sweden</span></td><td></td></tr></table></td><td><script type="text/javascript"><!--
google_ad_client = "ca-pub-7211665888260307";
/* rektanglar i lista */
google_ad_slot = "7024728308";
google_ad_width = 336;
google_ad_height = 280;
//--></script><script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script><br><script type="text/javascript"><!--
google_ad_client = "ca-pub-7211665888260307";
/* rektanglar i lista */
google_ad_slot = "7024728308";
google_ad_width = 336;
google_ad_height = 280;
//--></script><script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></td></tr></table></div>

Can you see how I should do to reduce to blank space I get? Thank you

EDIT: Inserting a <br> into the code at a place makes the gap smaller:

How to reduce blank space in html? [closed]

I think that the gap of the first <tr> level above shouldn't be there.

I've uploaded the code to a hosting: www.montao.com.br/li


I can't read that terrible mess you pasted, but I think its really simple. You are probably using tables for layout. And it looks like this:

<table>
  <tr>
    <td><!-- here are your images (elements.. list.. whatever) --></td>
    <td><!-- ads are here --></td>
  </tr>
</table>

That cell containing ads is stretched (so ads can fit in) and it stretches also other cells in row.

Solution? Move ads outside of your content table :)


You can wrap your content in a div

<div id="content" >Your content Here</div>

and give it a negative margin like so:

#content{
margin: - 100px;
}

or you could try and delete your page and design it in a different way.

EDIT:

another solution would be to wrap the ads in a div and the content and float the beside each other:

#content , #ads{
float: left;
}

make sure you expand your main content box a bit otherwise it won't work.

EDIT 2:

use a table tag instead.

<table border="1">
<tr>
<td height="600" width="600">CONTENT</td>
<td height="600"  width="200">SIDEBAR</td>
</tr>

</table>

this code wouldn't show ANYTHING until everything inside the table is fully loaded

hence i recommend using css, it's good for you.

:)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜