it seems that <ul> has extra margin or padding to the left of it even when bullet is set to not to show…
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
...
<style type="text/css">
ul {
list-style-image:none;
list-style-position:outside;
list-style-type:none;
}
</style>
<div style="width: 300px; font: 12px Arial;background:#ff0">
<ul>
<li>hello world hello world hello world hello world</li>
</ul>
</div>
On IE 6 and 7, we can get rid of the left spacing by margin-left: 0 (by adding to the style of “ul”)
and we need an extra margin-bottom: 0 to get rid of extra margin at the bottom.
But adding those won’t work on FF and Chrome. We need padding-left: 0 so that the spacing is gone.
So i just added margin: 0; padding: 0 to the style of “ul” and it seems to work all fine.
Is this the general rule? It seems that designers like to use <ul> to design for tab, links, etc… is it because they make more semantic sense? just that the extra spacing will cause problem when there are elements near by and the <ul> items get wrapped to the next line. thanks.