Click here to get back home

DIV wraps when it shouldn't

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
DIV wraps when it shouldn't plenty900 02-29-2008
Posted by plenty900 on February 29, 2008, 7:15 pm
Please log in for more thread options
Hi all,

I have several DIVs side by side, and the last one wraps when it
shouldn't.
The reason is ostensibly that the text inside is very wide, i.e. that
the
text inside does not wrap.

What determines the one that will wrap? i.e.
1. the DIV
2. the text paragraph inside?

Thanks.

Posted by dorayme on February 29, 2008, 7:46 pm
Please log in for more thread options
In article
<2b83e369-7b40-4f82-875f-f460872e9cfd@n58g2000hsf.googlegroups.co
m>,
plenty900@yahoo.com wrote:

> Hi all,
>
> I have several DIVs side by side,

and you did exactly what to get this?

> and the last one wraps when it
> shouldn't.

Are you sure it shouldn't? How, why, what, where?

> The reason is ostensibly that the text inside is very wide, i.e. that
> the
> text inside does not wrap.
>

If you have floated a set of divs or otherwise in-lined them,
then, of course, when the line runs out of space, the ones that
cannot fit, flow onto the next line. There can be a number of
reasons why divs can be wider than you expect, one of them being
long unbroken text like in a URL. If a div has such a line, and
if it is floated, the div will be as wide as the line at least
(floated boxes are shrink to fit).

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Untitled Page</title>
<style type="text/css">
div {
float: left; border: 1px solid;
}
</style>
</head>
<body>
<div>lineoftext</div>
<div>lineoftextabitlonger</div>
<div>muchlongerlineoftextaltogetherinfactaverylonglineoftextindeed
when youcometothinkofsomewidthsitmightbewantingtosqeezeinto</div>
</body>
</html>




> What determines the one that will wrap? i.e.
> 1. the DIV
> 2. the text paragraph inside?
>
> Thanks.

--
dorayme

Posted by plenty900 on February 29, 2008, 8:21 pm
Please log in for more thread options

Thanks for your reply. I should explain, I'm trying to
remove all tables from a webpage.

Currently I have a table like this:

<table width=100%><tr>
<td width=50>text text<td width=50> text text<td
width="*">dflajlfadljfalfkjdaslkaasldkjflakjdfaadslkjsdlfkjadslkfjalkjfldskjlfjdsldkjlksdjflsdkjfldskj
</table>

In tables, TDs never wrap of course.

So really my question is, how to achieve the same thing with DIVs?

I assume that underlying both DIVs and TDs are the same fundmental
mechanisms.

Thanks.



Posted by dorayme on February 29, 2008, 8:49 pm
Please log in for more thread options
In article
<5494a002-9306-4452-9a58-72495e8e1b70@e23g2000prf.googlegroups.co
m>,
plenty900@yahoo.com wrote:

> Thanks for your reply. I should explain, I'm trying to
> remove all tables from a webpage.
>
> Currently I have a table like this:
>
> <table width=100%><tr>
> <td width=50>text text<td width=50> text text<td
> width="*">dflajlfadljfalfkjdaslkaasldkjflakjdfaadslkjsdlfkjadslkfjalkjfldskjlf
> jdsldkjlksdjflsdkjfldskj
> </table>
>
> In tables, TDs never wrap of course.
>
> So really my question is, how to achieve the same thing with DIVs?
>
> I assume that underlying both DIVs and TDs are the same fundmental
> mechanisms.
>
> Thanks.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Untitled Page</title>
<style type="text/css">
#container {width: 50em;}
div.short {float: left; width:50px;}
div.long {float: left;}
</style>
</head>
<body>
<div id="container">
<div class="short">text text</div>
<div class="short">text text</div>
<div>dflajlfadljfalfkjdaslkaasldkjflakjdfaadslkjsdlfkjadslkfjalkjf
ldskjlfjdsldkjlksdjflsdkjfldskj</div>
</div>
</body>
</html>

But don't do this. Instead read
<http://www.htmldog.com/guides/htmlbeginner/> and
<http://en.wikipedia.org/wiki/Semantic_Web>

--
dorayme

Posted by plenty900 on February 29, 2008, 9:41 pm
Please log in for more thread options

Thanks again. For some reason, my HTML is not doing
what your example is doing. I think I will have to start from
scratch to determine what's going on. One complication
is that I have another DIV floating on the righthand side,
and my short DIVs contain DIVs within them.



Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap