472,986 Members | 2,878 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,986 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 7155
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{...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

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.