[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

word-wrap: break-word; issues with Google Chrome

Posted on 2010-11-10
3
Medium Priority
?
1,343 Views
Last Modified: 2012-05-10
I have a web application which uses a Gridview, the gridview has a column called comments which usually is more than 50 words long .
I am using word-wrap: break-word; in a css class and this works like a charm on IE, but cant make it work with Google Chrome,,, does anybody have a solution for this?
0
Comment
Question by:TonyReba
  • 2
3 Comments
 
LVL 22

Expert Comment

by:remorina
ID: 34107947
word-wrap is a CSS3 selector and as far as I'm aware of, it should be supported by modern browsers including Webkit Google Chrome and Safari.

The example code below has been tested and works well for me on Safari, Chrome, IE and FF
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Example</title>
</head>
<body>
    <div style="width:50px;border:solid 1px red;word-wrap:break-word;">
        VeryLongWordThatShouldBreak
    </div>
</body>
</html>

Open in new window

0
 
LVL 9

Author Comment

by:TonyReba
ID: 34109113
so the issue is that is actually being applied to an asp.net gridview row ?
0
 
LVL 22

Accepted Solution

by:
remorina earned 800 total points
ID: 34109259
An asp.net renders html to the browser and the gridview redners a table and css should still work normally regardless of the engine being used to render the markup if it was clean and supported.

I haven't tested the word-wrap on table cells though, in my example it was a single div, but with complex structure sometimes odd behaviour might result in browser compatibility especially with CSS3 selectors since they are still under continual support and enhancement.

I suspect that in your case that the code being rendered produces a situation where webkit doesn't apply the selector, maybe because the table cell or maybe because no width was explicitly specified, there could be numerous reasons.

I would try specifying a width for the table cell having the word-wrap if possible, otherwize it might require another control or some kind of ControlAdapter to render divs instead of tables if there were any.

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question