Forums: Rockclimbing.com: Suggestions & Feedback:
Word-wrap + inline-block + max-width
RSS FeedRSS Feeds for Suggestions & Feedback

Premier Sponsor:

 


jumpingrock


Jan 29, 2011, 11:12 AM
Post #1 of 5 (1604 views)
Shortcut

Registered: Dec 15, 2002
Posts: 5684

Word-wrap + inline-block + max-width
Report this Post
Average: avg_1 avg_2 avg_3 avg_4 avg_5 (0 ratings)  
Can't Post

I was looking at this thread: http://www.rockclimbing.com/...d;page=unread#unread

and it looks pretty ugly because of the long ass word. A slightly better usage of css would fix that issue. Your html is pretty poorly formed (works but still poorly formed - ie: you should be giving all your html elements a css classes so that you can format them with external css files) but still fixable. if you give the <font> element that you use to display the actual message the following css it will wrap the long words to whatever maximum size you want (this won't work in ie7 but ie7 is shit anyway). Of course, you should also not be using a font element at all, but that's beside the point. Use a div element and give it a class and style that in css.

element.style {
display: inline-block;
max-width: 1000px;
word-wrap: break-word;
}

Cheers,

David


ddt


Feb 2, 2011, 4:58 AM
Post #2 of 5 (1542 views)
Shortcut

Registered: May 20, 2005
Posts: 2304

Re: [jumpingrock] Word-wrap + inline-block + max-width [In reply to]
Report this Post
Average: avg_1 avg_2 avg_3 avg_4 avg_5 (0 ratings)  
Can't Post

I've made a quick fix, although I'm not sure if it works in IE. Firefox seems fine.


sbaclimber


Feb 3, 2011, 12:49 AM
Post #3 of 5 (1529 views)
Shortcut

Registered: Jan 21, 2004
Posts: 3066

Re: [ddt] Word-wrap + inline-block + max-width [In reply to]
Report this Post
Average: avg_1 avg_2 avg_3 avg_4 avg_5 (0 ratings)  
Can't Post

ddt wrote:
I've made a quick fix, although I'm not sure if it works in IE. Firefox seems fine.
IE8 => Frown

Edit: aha...here's the problem, and easy fix...Wink
element.style {
display: inline-block;
max-width: 1000px;
word-wrap: break-word;
}


(This post was edited by sbaclimber on Feb 3, 2011, 12:58 AM)


ddt


Feb 3, 2011, 7:54 PM
Post #4 of 5 (1510 views)
Shortcut

Registered: May 20, 2005
Posts: 2304

Re: [sbaclimber] Word-wrap + inline-block + max-width [In reply to]
Report this Post
Average: avg_1 avg_2 avg_3 avg_4 avg_5 (0 ratings)  
Can't Post

Turns out my "quick fix" caused a few other problems Frown, so I've reversed it for now until a more robust solution can be implemented.


sbaclimber


Feb 4, 2011, 12:17 AM
Post #5 of 5 (1501 views)
Shortcut

Registered: Jan 21, 2004
Posts: 3066

Re: [ddt] Word-wrap + inline-block + max-width [In reply to]
Report this Post
Average: avg_1 avg_2 avg_3 avg_4 avg_5 (0 ratings)  
Can't Post

ddt wrote:
Turns out my "quick fix" caused a few other problems Frown, so I've reversed it for now until a more robust solution can be implemented.
Isn't CSS fun!? Wink


Forums : Rockclimbing.com : Suggestions & Feedback

 


Search for (options)

Log In:

Username:
Password: Remember me:

Go Register
Go Lost Password?



Follow us on Twiter Become a Fan on Facebook