Unsorted list <UL> left alignment

G

Guest

Hi there
I can not align an <UL> statement to the beginning of the page
My left frame has to be wider than necessary because of this
Is there a way to align an <UL> statement
Thanks

Here follows the code
<html><body leftmargin="0"
12345678
<UL>
<LI>1.1</LI></UL></body></html>
 
S

Stefan B Rusynko

Not possible do to the nature of a list tag which by it's design include an indent

- you could try negative margins using CSS, but that is unsupported and unpredictable

--




| Hi there,
| I can not align an <UL> statement to the beginning of the page.
| My left frame has to be wider than necessary because of this.
| Is there a way to align an <UL> statement.
| Thanks,
|
| Here follows the code:
| <html><body leftmargin="0">
| 123456789
| <UL>1
| <LI>1.1</LI></UL></body></html>
 
J

Jon

You wouldn't want a negative margin - that would take the list off the side
of the page. Lists include default margin(in IE) and padding(in Moz
browsers) of 1em. So we can modify this, eg
<style type="text/css">
ul{
margin-left:0;
padding-left:0;
}
</style>
<p>The text in the list below will be flush with the <p> text - but the
bullets will be cut off</p>
<ul>
<li>Item One</li>
<li>Item Two</li>

<style type="text/css">
ul{
margin-left:.5em;
padding-left:.5em;
}
</style>
<p>The bullets below will be flush with the <p> text</p>
<ul>
<li>Item One</li>
<li>Item Two</li>

Jon
Microsoft MVP - FP
 
J

Jack Brewster

Valmir,

You could use Cascading Style Sheets (CSS) to remove the leading white space
before the list items. Add the following within the head of your file:

<style type="text/css">
<!--
ul {
margin-left: 0;
padding-left: 0;
}
li {
margin-left: 1em;
}
-->
</style>

If you want to drop the bullets entirely, use this:

<style type="text/css">
<!--
ul {
margin-left: 0;
padding-left: 0;
list-style-type: none;
}
li {
margin-left: 0;
list-style-type: none;
}
-->
</style>

I tested both methods on several browsers and browser versions and the only
one that it doesn't work in is Netscape 4 (no big surprise). The effect in
NS4 is that the left spacing remains the same, but the bullets disappear
with both techniques. I don't have a Mac, so I don't know if this will
have display issues on the common Mac browsers.

For more information on CSS, check out these sites:
http://www.htmldog.com/guides/cssbeginner/
http://www.mako4css.com
http://www.w3schools.com/css/

Good luck!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

password-protected web page 2
CSS Trouble 2
CSS controlled multi-level list 2
CSS menu 1
CSS Problems 8
"inititally collapsed" CheckBox (?) 4
CSS Menu and Frontpage 2003 4
UL list-style-image not working 4

Top