PDA

View Full Version : indenting an unordered list


albinooscar
11-07-2002, 07:03 AM
Hi all!

I'm fairly new to this html stuff and am trying to create a web page with an unordered list <ul> on it.

What I want to do is indent each line the same amount.

I've tried using the tag <pre> but it does not seem to work on unordered lists.

How can I do this?

albinooscar
11-07-2002, 07:29 AM
I figured out a way to do it! :D
It's probably not the best way, but it works.

I just embedded lists in lists. Like this:

<ul>
<ul>
<ul>
<ul>
<ul>
<li type=disc><a href="Charter.htm">PROJECT CHARTER & TEAM MEMBERS</a>
<li type=disc><a href="WhatsNew.htm">WHAT'S NEW</a>
<li type=disc><a href="feedback.htm">FEEDBACK - To 6 Sigma Team</a>
</ul>
</ul>
</ul>
</ul>
</ul>


Of coarse, if anyone knows of a better way, please post!

DCElliott
11-07-2002, 09:00 AM
Here are some list style examples using CSS, including the indentation you requested. Some are done with inline styles and for others the styles are defined in the <head>. Note the use of contextual selectors "UL.special LI" and "UL.special2 LI" to alter the list style for the LI elements

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
"http://www.w3.org/TR/REC-html40/strict.dtd">
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<style type="text/css">
UL.special LI {list-style:none; display:
inline;
padding:0 1em;
margin: 0 3px;
color:white;
background:green;
border:3px outset green;}
UL.special2 LI {list-style:none; display:
inline;}
UL.special2 LI:before {content:" :: ";}
</style>
<title>Untitled</title>

</head>
<body>
A few different bullet types
<ul
style="list-style-type: square; list-style-position: outside; list-style-image: none;">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>

</ul>
Note how we get spacing with padding
<ul
style="list-style-type: circle; list-style-position: outside; list-style-image: none; padding-left: 3em;">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>

</ul>
Image and display at right (great for navs)
<ul
style="list-style-image: url(http://developers.evrsoft.com/forum/ravimages/vb_bullet.gif); padding-left: 3em; direction: rtl;">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>

</ul>
Roman numerals
<ul style="list-style-type: upper-roman;">
<li style="marker-offset: 6em;">Item 1</li>
<li style="marker-offset: 6em;">Item 2</li>
<li style="marker-offset: 6em;">Item 3</li>
<li style="marker-offset: 6em;">Item 4</li>

</ul>
Compact style
<ol
style="list-style-type: disc; list-style-position: inside; list-style-image: none;">
<li>Item 1<br>
with a second line</li>
<li>Item 2<br>
with a second line</li>
<li>Item 3<br>
with a second line</li>
<li>Item 4<br>
with a second line</li>

</ol>
You can even have an inline list that looks like buttons.
<ul class="special">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>

</ul>
You can even have an inline list that has funky dividers (separators
won't show up in older browsers).
<ul class="special2">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>

</ul>

</body>
</html>

albinooscar
11-07-2002, 11:56 AM
Thanks DC!

Thats a lot of stuff! But I managed to use what I needed.


I even thought of using a table and seperating/moving my text that way.

Your way (the proper way) worked a lot better.

Thanx!