Forum Moderators: not2easy

Message Too Old, No Replies

format problem with <li>

         

secureitall

6:30 pm on Sep 11, 2003 (gmt 0)

10+ Year Member



Hi,

I am trying to solve a formatting problem and so far I have no luck. My problem is that list text are not align properly. For example, LIST #1 is very long so the text continued onto line#2. However, text on line #2 is not align properly with text on line #1

Here is my code and sample so you can see what I mean


<html>
<head>
<title>list</title>
<style type="text/css">
ul#list{width:500px; border: 2px solid #CCC;
padding:10px; margin:10px 10px 0 45px;}
ul#list li{color:#333; list-style-position: inside; font-family: arial; font-size: 12px;}
</style>
</head>
<body>
<ul id="list">
<li>Random text A Random text A Random text A Random text A Random text A Random text A </li>
<li>Demo demo Demo demo Demo demo </li>
<li>Rdemo b Rdemo b Rdemo b Rdemo b Rdemo b Rdemo b Rdemo b Rdemo b Rdemo b Rdemo b Rdemo b</li>
</ul>

</body>
</html>

Thanks in advance for any advices :-)

SuzyUK

8:31 pm on Sep 11, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The problem here is the list-style-position.. by setting to inside you are specifying that bullet should appear inside the "box" created by the list item..

While this is a handy margin/padding workaround when trying to style list items without bullets, it is what is causing the "undesired wrap" in this instance..

You need to respecify the list position to outside or leave it out altogether as "outside" is the default.

When you do this you will need to adjust your left margin and padding to suit.
Note: as different browsers apply the left position differently it's best to make sure they (left margin and left padding) are both the same.

Suzy

secureitall

12:23 pm on Sep 12, 2003 (gmt 0)

10+ Year Member



Thxs for your help Suzy. Much appreciated for your detailed explanation.

:-) Thxs

::Gerald::