HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
unwanted space between left side and li
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Table
View previous topic :: View next topic  
Author Message
GabrielJordan0891



Joined: 14 Aug 2008
Posts: 3

PostPosted: Thu Aug 14, 2008 11:56 am     unwanted space between left side and li Reply with quote

Okay, I am just getting back into coding and have been messing around with the html part. I have made a table, one col, two row. However ther is a huge space left of my list that I would like to get rid of and would like to know how it came about. So help for both would be appreciated. I will just give the code from where the table begins.
<table width=15% Rules=none Frame=Void cellspacing="0" cellpadding="0">
<tr BGCOLOR="blue">
<td>Useful Links</td>
</tr>
<tr>
<td>
<ul class="Navbartopleft">
<li><a href="kldjfido">Generator Sizing Guide</a></li>
<li>Rebates</li>
<li>Payment Methods/Discounts</li>
<li>Returns/Cancellation Policy</li>
<li>Shipping Policy</li>
</ul>
</td>
</tr>
sticks464



Joined: 31 Dec 2006
Posts: 2308

PostPosted: Thu Aug 14, 2008 12:24 pm     Reply with quote

By default list have a margin to the left to display the list-style-type. If you do not want the style to display it can be removed and using negative margin to slide the list back to the left.

This goes in the head section
Code:
<style type="text/css">
.Navbartopleft {
margin-left:-40px;/* move list to the left */
list-style:none;/* remove the left style */
}
.Navbartopleft li {
display:block;/* gives each list item it's own space to be styled */
margin:5px 0;/* adds space between each list item */
}
</style>


If you want the round circle next to the list item remove the line
Code:
list-style:none;

Now you must reduce the left-margin to accommodate the circle
Code:
margin-left:-25px;
GabrielJordan0891



Joined: 14 Aug 2008
Posts: 3

PostPosted: Thu Aug 14, 2008 4:16 pm     ty Reply with quote

thank you very much.
hanikhanafer



Joined: 05 Nov 2009
Posts: 1

PostPosted: Thu Nov 05, 2009 6:55 pm     the solution is valid for IE and FF but not safari Reply with quote

the solution is valid for IE and FF but not safari
do you know howto sole in Safari please?

Hani
sticks464



Joined: 31 Dec 2006
Posts: 2308

PostPosted: Thu Nov 05, 2009 8:09 pm     Reply with quote

You can use the css resets. Modify as needed. It will remove all browser defaults, eliminate padding and/or margins and list styles from lists. Works for all browsers.
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Table All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
DARFUR
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial