How to control a running text? This is a user generated content, where user used to give with out giving space to the text. for example:
abcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefgh
This goes beyond the specific block. Is there is a way to wrap the text? how can i control it and i also want that to be worked in ie6 also...
You can make strings with no spaces wrap by using the following CSS property:
word-wrap: break-word;
According to the MDC page on the word-wrap property, it is supported in IE 5.5+, Firefox 3.5+, and Safari 1.0+ (but not Opera).
You could use overflow:scroll; in your CSS, this would put a horizontal scroll bar. Should work in IE.
Related
I have a dojo text area which I'm binding it to a field. I saw that on browser, its height is OK but if I open the xpage in the Notes client its height is twice bigger. I tried adding height property for the text area, but it doesn't work.
Thanks in advance!
Browsers Firefox and XPiNC (XPages in Notes Client - that is XULrunner based on Firefox) show Dojo Text Area (dijit.form.Textarea) always with at least two rows even it contains only one line of text.
Other browsers like Chrome and IE work like expected.
You don't have a chance to change that behavior with style "height"/"minHeight" or parameter "rows".
The only solution I found is to create an own Textarea widget. But I am not sure if it's worth it...
This issue shows up only for contents with one line. As soon as you have two or more text lines Dojo Text Area's height adapts exactly - for all browsers.
Try setting the height using css styles, that should do it.
Update:
In case css should not be working here try using the classic HTML attributes 'cols' and 'rows'. I don't have Domino Designer ata hand right now, so I can't tell whether those attributes are available. If not you could add them yourself using the 'attrs' group.
I was wondering if it were possible to write an extension for a browser which would change the color of text, or otherwise transform it (underline, bold, etc) without modifying the markup.
As an example:
HTML
<p>Extensions use JS, and have to modify the DOM<p>
Default Rendering
Extensions use JS, and have to modify the DOM
Desired Rendering
Extensions use JS, and have to modify the DOM
Now, I know that Extensions can modify the DOM, and to get what I wanted I could get something like:
<p>Extensions use JS, and <html:span style="font-weight: bold; font-style: italic;">have</html:span> to modify the DOM</p>
So, what I'm trying to do is NOT change the markup, at all. This would be something like the "Highlight all" functionality that you get when you're doing a "Find" on a page.
Current Solution
I found an extension which fits as a viable solution to my problem:
It's All Text!
While I would still like to have native browser highlighting, without modifying the markup, this will do fine.
You could inject CSS to make existing markup behave differently (e.g., p { font-weight:bold; } to bold all <p> elements, or .foo { background-color: green } to alter all elements with a foo class, etc.), but there is almost certainly no extension-level way to accomplish what you want. You'll have to modify the markup of the page if you want to modify arbitrary text on the page.
The only way to do what you want is to hack some low-level code and actually rewrite parts of WebKit and Gecko so that HTML is rendered differently than it should be.
I found an extension which fits as a viable solution to my problem:
It's All Text!
While I would still like to have native browser highlighting, without modifying the markup, this will do fine.
This pulls it out of the page, into an editor, and syncs them up. Works beautifully.
This is a two part problem. Solving it for Firefox breaks IE6, and solving it for IE6 breaks Firefox. WebKit works fine.
This demonstrates the problem in Firefox: http://jsfiddle.net/UpZca/2/
"Import Submission" link is slightly higher than "Export Submission", which is a problem. IE6 works fine at this point - the alignment is correct.
I know that when using 'inline-block', vertical alignment issues can be fixed with vertical-align:top, so I tried that first. You can see that it fixes the problem in Firefox: http://jsfiddle.net/UpZca/1/
However, with this change IE6 decided that it is going to move "Import Submission" down all the way to the bottom of the invisible file input. Take a look at the last link again in IE6 to see what I mean.
btw, jsfiddle doesn't render the code the same way as pure IE6 does. In the links above, my text is covered up by the gray Browse button from the file input. In pure IE6 that doesn't happen, but this still demonstrates the positioning problem.
So, is there any way for me to make this code work in IE6 and Firefox?
Any ideas would be appreciated (except the one about not using IE6 :))
I ended up using Javascript to programatically add the vertical-align: top style if the browser is not IE.
A brief look tells me that the problem might be because IE6 does not support inline-block. Whenever you use inline-block, you will also need to do this:
*display: inline;
*zoom: inline;
These two lines are equivalent to display: inline-block for IE 6 and 7.
With this set, you can then probably figure out a cross-browser solution for the issue by adding vertical-align: top to the first anchor tag or qq-upload_button.
How does jQueryMobile shows "..." when there's not enough space to view all the text?
Is it an CSS attribute?
There is a CSS attribute for this -- it is text-overflow:ellipsis;.
However, there is one problem with it: it doesn't work in Firefox. It works in all other browsers, but not Firefox, not even FF4. I understand it's planned for FF5 or FF6.
In Firefox, it would need to be done using pure Javascript, which is where the JQuery would need to do some work. To do it accurately, it would need to calculate the physical size of the text in pixels, character by character. It is possible that it does use the CSS property in other browsers. It would make sense.
See this post: text-overflow:ellipsis in Firefox 4? (and FF5) for a further discussion of this issue specific to Firefox.
Since long time i been having a real problem with the different ways that each browser display text.
Sure you have noticed that even when you create a stylesheet specifying everything about the font properties, still every browser display the same text with some differences, the usual problem is the font weight, that even if you specify it different browsers display it different ways.
I would like to know if some as come with a solution. Not turning the text into a image.
Thanks.
EDIT:
This is a example of the problem. On the left Firefox and right IE. However i have defined in the CSS font family, weight, size and still they render the fonts different.
Snapshot
Do you mean that on one browser its bold and another one its normal? A reset should fix that, but if it doesn't, it might be something overriding that.
If you're talking about fonts looking different, it is possible - for example, since Google Chrome / Chromium sandboxes the renderer process, the font rendering won't be affected by other parts of the system, and I believe that it uses some sort of special font rendering. To be honest, on my Linux install, I do get bolder fonts on Chromium, but Firefox displays them fine.
There's SIFR (as pointed above), but it needs Flash and it is a bit heavy. There's also Cufon http://cufon.shoqolate.com/ that uses Javascript. Could you show a screencast so we know what's the problem? Thanks.
SIFR is a good solution, as long as you're only trying to control the appearance of small chunks of text (headings, design elements, etc.)
Beyond that, browsers are perfectly allowed to render text any way they want, and getting it pixel-perfect between browsers and operating systems is usually not even desirable for larger chunks of text. Users will have different accessibility settings and anti-aliasing settings which are tuned to the way they want to read text, and in general websites should try to respect that.
You can use SIFR.
Although this problem is already about a week old, here is a solution that I found, that might be related:
http://blog.wolffmyren.com/2009/05/28/jquery-fadeinfadeout-ie-cleartype-glitch/
If you're not using jQuery, try removing the filter attribute from the elements that are displaying non-Cleartype'd text and it should work, according to that blog post.