Jump to content

Text Wrapping in a Floated DIV

Recommended Posts

Suppose I have two DIVs, one floated to the left and one not floated. The text of the non-floated one will wrap around the floated one just fine. However, as the text in the floated one increases, it pushes further and further right on the page.Is there a way to set the floated DIV's text to always wrap, such that it will never be wider than the largest word it contains?This is for a set of left-column navigational links where it should be as narrow as possible. I'm reluctant to set any kind of pre-defined width or max-width as you never know what the name of a link will be in there and I wouldn't want it to spill out of the DIV.Page in question: http://www.cyber0ne.com/test/cssAny ideas?-cyber0nehttp://www.cyber0ne.com

Link to post
Share on other sites
well... why don't you simply add a <br> instead of a space in your navigation?

I'm hoping to avoid <br> as much as possible in my designs, since it'll be more of a roadblock should I want to change my website's layout by simply swapping out the stylesheets.Also, much of my nav column will be dynamically generated, so for any given page throughout the site (and there are many) there could be all kinds of different links in there. If there's one called "Miscellaneous" then I wouldn't want one called "About Me" to wrap, since there's plenty of room for it on one line with the former link stretching the DIV out.-cyber0nehttp://www.cyber0ne.com
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...