Jump to content

Text Wrapping in a Floated DIV


cyber0ne

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 comment
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 comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...