Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > CSS > CSS Cascading Style Sheets
|
CSS Cascading Style Sheets All issues relating to Cascading Style Sheets (CSS).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the CSS Cascading Style Sheets section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 1st, 2013, 04:25 AM
Authorized User
 
Join Date: Dec 2009
Posts: 85
Thanks: 16
Thanked 0 Times in 0 Posts
Default wrapping text in ul li elements in a tree structure

Hi there

I've got limited space in an organisational cascading tree structure - I need to wrap the entries in the tree structure so that the long lines do exactly that - wrap.

I've tried defining a width for the ul and the parent div and have also tried the white-space:nowrap but nothing seems to touch it.

I've uploaded a screen shot to http://www.twm-hosting.co.uk/ul.png

to help you visualise it

Any help greatly appreciated!

thanks
 
Old June 1st, 2013, 08:20 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Can you please post the URL to a sample page? We can't say what's wrong from a screen cap.

Generally text wraps if you don't stop it from doing so, lists are no exception. One way to stop it from wrapping is using white-space:nowrap, so that's not a good idea. Something, probably in your CSS, stops the text from wrapping.

Look at this. As long as the words aren't too long the text wraps.

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html>

<head>
<title>List lines wrap too</title>

<style type="text/css">
ul   { width: 3.5em; border: dashed }
</style>

</head>


<body>

<ul>
<li>Good morning</li>
<li>Rumpelstiltskin</li>
<li>'Twas brillig and the slithy toves</li>
</ul>

</body>
</html>
__________________
--
http://yupapa.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving li node to another ul list using darg and drop mingtatl BOOK: Beginning JavaScript and CSS Development with jQuery 1 September 6th, 2010 03:36 AM
create <ul> with alternating class on <li> element Brian Campbell XSLT 2 November 3rd, 2006 06:07 PM
Need help with tree data structure vidhya_venkat C++ Programming 0 June 14th, 2006 01:13 PM
Something about li and ul sfs00784 CSS Cascading Style Sheets 1 July 31st, 2005 02:03 AM
TREE USING UL/LI pallone Javascript How-To 11 February 16th, 2005 04:03 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.