PDA

View Full Version : Automatic line break for Lists


Railsplitter44
04-14-2008, 02:43 AM
Hello,

I'm in the middle of creating an unordered list and for some reason, there is an automatic line break between list items.

For example, it looks like this:
first item
second item
third itemThis is what I would like it to look like (no line breaks):
first item
second item
third itemIs there any tag or css attribute that can change this? I can't seem to figure it out.

Thanks for the assistance

mangofreak
04-14-2008, 03:23 AM
what's your code??

Railsplitter44
04-14-2008, 03:27 AM
Here's my code

<ul>
<li>
<a href="../phpBB2/viewtopic.php?p=<?php echo $row_topics['post_id']; ?>#<?php echo $row_topics['post_id']; ?>"><?php echo $row_topics['topic_title']; ?></a></a>
<br />
-Posted by: <a href="../phpBB2/profile.php?mode=viewprofile&amp;u=<?php echo $row_topics['user_id']; ?>"><?php echo $row_topics['username']; ?></a>
<br />
-<?php echo $row_topics['topic_replies']; ?> replies / <?php echo $row_topics['topic_views']; ?> views
</li>
</ul>

mangofreak
04-14-2008, 03:46 AM
I cannot explain it. :(

very interesting. Is there already a CSS affecting your UL???

Railsplitter44
04-14-2008, 04:36 AM
There isn't a CSS affecting the UL. It's really odd, could it be because I have a repeat region?

davidj
04-14-2008, 06:55 AM
Here's my code

<ul>
<li>
<a href="../phpBB2/viewtopic.php?p=<?php echo $row_topics['post_id']; ?>#<?php echo $row_topics['post_id']; ?>"><?php echo $row_topics['topic_title']; ?></a></a>
<br />
-Posted by: <a href="../phpBB2/profile.php?mode=viewprofile&amp;u=<?php echo $row_topics['user_id']; ?>"><?php echo $row_topics['username']; ?></a>
<br />
-<?php echo $row_topics['topic_replies']; ?> replies / <?php echo $row_topics['topic_views']; ?> views
</li>
</ul>

ok

the first line you have ...


</a></a>


remove one as its invalid

you also have...

<br />


try removing that also (you have have a couple of them in the example)

your example shows only one entry in your list! is this correct?

Cary
04-14-2008, 07:02 AM
Oh, nevermind... DJ just answered it.

Railsplitter44
04-14-2008, 01:43 PM
I removed the duplicate </a> but that didn't do anything. I didn't remove the line breaks because they are valid and wouldn't effect the break between list items. I'm assuming that this problem stems from the fact that it is a repeat region of an sql query. That's why there is only one entry in my list.

davidj
04-14-2008, 01:55 PM
I didn't remove the line breaks because they are valid and wouldn't effect the break between list items

why are you using them then?

Railsplitter44
04-14-2008, 02:01 PM
they are line breaks inside of each list item, for example:
Line 1
Line 2
Line 3
Line 1
Line 2
Line 3There are line breaks seperating lines 1,2, and 3, but they are still in the same list item

davidj
04-14-2008, 02:12 PM
right

you need to post the full code so we can get a full picture and can trouble shoot properly

edbr
04-15-2008, 02:31 AM
shoudnt each list be in its own then? so
<ul>
<li>
<a href="../phpBB2/viewtopic.php?p=<?php echo $row_topics['post_id']; ?>#<?php echo $row_topics['post_id']; ?>"><?php echo $row_topics['topic_title']; ?></a>
</li>
<br/>
<li>
-Posted by: <a href="../phpBB2/profile.php?mode=viewprofile&amp;u=<?php echo $row_topics['user_id']; ?>"><?php echo $row_topics['username']; ?></a>

</li>
</ul>

mangofreak
04-15-2008, 04:37 AM
I think that the the List doesn't like it having the <a href=" " > as the first thing on the line. If you put some text before the <a href=""> then it should work fine.
It worked for me testing.



<ul>
<li>
Link Number one:<a href="../phpBB2/viewtopic.php?p=<?php echo $row_topics['post_id']; ?>#<?php echo $row_topics['post_id']; ?>"><?php echo $row_topics['topic_title']; ?></a></a>
<br />
-Posted by: <a href="../phpBB2/profile.php?mode=viewprofile&amp;u=<?php echo $row_topics['user_id']; ?>"><?php echo $row_topics['username']; ?></a>
<br />
-<?php echo $row_topics['topic_replies']; ?> replies / <?php echo $row_topics['topic_views']; ?> views</li>
<li>Link number two:
<p>&nbsp;</p>
</li>
</ul>

Railsplitter44
04-15-2008, 05:14 PM
I appreciate everyone's help but I figured out what the problem was. When I was selecting my text for the repeat region, I was selecting <ul> through </ul> which was creating a completely new unordered list for each repeated region.

What I did was just select from <li> through </li> which was repeating the list items and staying in the same unordered list.

Thanks again for all of your time and assistance