Well the hard coded HTML example isn't exactly the same as your JS
code, the hard coded equivalent is more like:

<div id="test"><span>lorem</span><span>ipsum</span><span>dolor</
span><span>sit</span><span>amet</span><span>consectetuer</
span><span>adipiscing</span><span>elit</span><span>sed</span></div>

(one line, no breaks)

And in that case, it's rendering fine because it thinks your <span>s
are just one word (CSS word-wrap defaults to not break words to
conform to parent width, fyi).

So your JS will need to insert breaks of some kind, inserting spaces
at the end of each span node for instance:

<script type="text/javascript">
var target = $('test');
target.appendChild(Builder.node('span', 'lorem '));
target.appendChild(Builder.node('span', 'ipsum '));
target.appendChild(Builder.node('span', 'dolor '));
target.appendChild(Builder.node('span', 'sit '));
target.appendChild(Builder.node('span', 'amet '));
target.appendChild(Builder.node('span', 'consectetuer '));
target.appendChild(Builder.node('span', 'adipiscing '));
target.appendChild(Builder.node('span', 'elit '));
target.appendChild(Builder.node('span', 'sed '));
</script>

On Feb 18, 8:11 am, Michael Peters <[EMAIL PROTECTED]> wrote:
> I'm trying to create some JS that will auto-create some <span> tags (I've 
> tried
> it with <font>, <strong> and a host of others with the same problem) inside 
> of a
> <div>. The div's width is set, but the <span>s stay on 1 line and spill over
> without respecting the parent's width. If I just have the same structure as
> normal HTML then it works fine. This happens in IE and FF.
>
> http://plusthree.com/~mpeters/span_test/test1.html
> vshttp://plusthree.com/~mpeters/span_test/test2.html
>
> Any ideas?
> --
> Michael Peters
> Developer
> Plus Three, LP


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to rubyonrails-spinoffs@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to