473,385 Members | 1,597 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

URGENT HELP: Text wrapping inside DIV.

Here is my HTML:
<style>
..leftcolumn{float:left;width:300px;border: 1px solid #ccc}
..rtcolumn{float:left;width:600px;border: 1px solid #ccc}
</style>

<body>
<div class="leftcolumn" id="d_links">
multiple <a href="hello.aspx?q=something">something</a><a
href="hello.aspx?q=something1">something1</a><a
href="hello.aspx?q=something2">something2</a><a
href="hello.aspx?q=something3">something3</a><a
href="hello.aspx?q=something4">something4</a><a
href="hello.aspx?q=something5">something5</a>........
</div>
<div id="d_content" class="rtcolumn">
long text here.............................................. ......

</div>
</body>

Issue:
The div with id "d_content" rendered is perfect the problem is with div
with id "d_links". The links(text) inside should wrap within the div
tags width but instead that is generated in one long line expanding the
DIV tag. Irrespective what width I assign to d_links it is rendered in
one line and pushes the d_content to next line in IE, whereas in FF
d_links goes under d_contents.

What is going on here? Any help will be greatly appreciated.

Thanks.

PS: I do not have this in public domain to show what is happening.

Mar 7 '06 #1
7 7216
ze****@gmail.com wrote:

<div class="leftcolumn" id="d_links">
multiple <a href="hello.aspx?q=something">something</a><a
href="hello.aspx?q=something1">something1</a><a
href="hello.aspx?q=something5">something5</a>........
</div>
<div id="d_content" class="rtcolumn">
long text here.............................................. ......
</div>

Issue:
The div with id "d_content" rendered is perfect the problem is with div
with id "d_links". The links(text) inside should wrap within the div
tags width but instead that is generated in one long line expanding the
DIV tag. Irrespective what width I assign to d_links it is rendered in
one line and pushes the d_content to next line in IE, whereas in FF
d_links goes under d_contents.

What does "perfect" mean to you? I have can think of 3 possibilities
right away.
The content of d_links is a solid line of text without whitespace. Where
is there to break?
You could add a <br> explicitly between each link. Or put each link in a
<p>.
Normally though, a list, <ul>, is used to layout a list of items. See
<http://css.maxdesign.com.au/listamatic/>

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Mar 7 '06 #2
My bad there is &nbsp; between each like below:

<div class="leftcolumn" id="d_links">
multiple <a href="hello.aspx?q=something">something</a>&nbsp;<a
href="hello.aspx?q=something1">something1</a>&nbsp;<a
href="hello.aspx?q=something2">something2</a>&nbsp;<a
href="hello.aspx?q=something3">something3</a>&nbsp;<a
href="hello.aspx?q=something4">something4</a>&nbsp;<a
href="hello.aspx?q=something5">something5</a>........
</div>

And the way I want it to be display is like this:
something something1
something2
something3 ....

depending upon the length of the inner text of anchor number of links
are fitted on one line.

When I said perfect, I meant, rendered the way I want it to. Items
inside are rendered without any flowing out or clipping unnecessarily.

I had considered using list but I have seen some site that could do it
without list tag.

Thanks.

Mar 7 '06 #3
On 6 Mar 2006 21:36:51 -0800, ze****@gmail.com wrote:
My bad there is &nbsp; between each like below:

<div class="leftcolumn" id="d_links">
multiple <a href="hello.aspx?q=something">something</a>&nbsp;<a
href="hello.aspx?q=something1">something1</a>&nbsp;<a
href="hello.aspx?q=something2">something2</a>&nbsp;<a
href="hello.aspx?q=something3">something3</a>&nbsp;<a
href="hello.aspx?q=something4">something4</a>&nbsp;<a
href="hello.aspx?q=something5">something5</a>........
</div>

And the way I want it to be display is like this:
something something1
something2
something3 ....


Huh? You mean you are putting NON-BREAKING spaces in and then wondering
why there are no line-breaks? Isn't the answer rather obvious?

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Mar 7 '06 #4
zeyais wrote:
My bad there is &nbsp;


NBSP = Non-Breaking SPace.

There is nowhere to wrap the text.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

Mar 7 '06 #5
Stephen Poley <sb******************@xs4all.nl> wrote:
Huh? You mean you are putting NON-BREAKING spaces in and then
wondering why there are no line-breaks? Isn't the answer rather
obvious?


The original poster forgot quite a many elementary principles of
posting to Usenet and specifically to c.i.w.h. groups. _Especially when
you need urgent help_,
- do not multipost
- don't even think of that!
- DO NOT SHOUT, IT HURTS PEOPLE'S EYES AND MAKES YOU LOOK UNFRIENDLY
- do not waste space in the Subject line to tell you need urgent help
- post the URL instead of wasting time in explaining why you are not
doing that
- use your real name, it always improves the impression that you
are serious and constructive.

See my response in c.i.w.a.stylesheets. The really urgent need is to
redesign the page, so that the problem is not created in the first
place.

Using just spaces between links, though common and not the worst of
mortal sins, is not good practice. Using e.g.
<a ...>...</a>&nbsp;| <a ...>...
is better: it puts visible (and audible) separators between the links
(and the &nbsp; prevents the separator from appearing at the start of a
line).

More logically, a list of links is written as a <ul> element, then (if
desired) styled with CSS so that it is rendered effectively as running
text, but there are considerable technical problems with this at
present (especially as regards to producing some visible separators).

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Mar 7 '06 #6
ze****@gmail.com wrote:
PS: I do not have this in public domain to show what is happening.


Then we do not have access to your private space to help you.

You've already posted one fragment that was critically inaccurate
(missing &nbsp;) and wasted everyone's efforts, compared to ust posting
a URL. Why should anyone bother to help someone who is deliberately
making things difficult for them?

Mar 7 '06 #7
ze****@gmail.com wrote:

I had considered using list but I have seen some site that could do it
without list tag.

Using a list element, <ul>, for a list of items is semantically correct
and painfully obvious. Who cares that other site's authors do not know how
to use a markup language?

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Mar 7 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: descds | last post by:
OK im prety much a newbie at PHP but it has me hooked. Im writing a comment system for one of our modules on phpnuke. Its all going very well, well should i say WAS going very well :) Ok all...
7
by: Robert Nicholson | last post by:
So I've got one page where I have an image inside a DIV with text-align: center and the image is correctly centered in that block. Making me think that text-align will center the contents of a...
4
by: Joseph | last post by:
The idea is to show only one of the <Baby_Div> while hiding all the others. At the moment all I have managed to do is to show each <Baby_Div> in turn as expected, but the problem is that once a...
3
by: Francesc | last post by:
Hi, After some years programming libraries and web based applications I'm trying to program my first not-silly windows application (something similar to an editor but just to annotate text...
0
by: PeteZ | last post by:
Inside HTML <TD> cells, I used to place <image src= . . . > statements with the align="right" or "left" option then place the text inside the same TD area. This would then allow browsers to auto...
3
by: N. Spiker | last post by:
I am attempting to receive a single TCP packet with some text ending with carriage return and line feed characters. When the text is send and the packet has the urgent flag set, the text read from...
3
by: zjw2112 | last post by:
Hello. I have some javascript code that dynamically creates a textarea and sets the wrap value to hard, which I thought would preserve CR/LF in the textarea: var otherTextArea =...
13
by: Stevo | last post by:
I've found that for IE6+, if you add the property text-align:center to a DIV, then *anything* inside it gets centered. That can be a table, an object/embed, another DIV, an image, or some text. ...
8
by: manugm1987 | last post by:
<?xml-stylesheet type="text/xsl" href="ch1.xsl"?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <style type="text/css"> span.cls_002{...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.