How to prevent word-wrap in an IE Content Editable div? - html

The Problem
I have a div that has contenteditable set to true. In Chrome, when the edge of the div is reached while typing, it shifts the entire word to the next line as expected. I present Exhibit A:
IE, as usual, doesn't behave as expected. When the edge of the div is reached while typing it breaks the word. I present Exhibit B:
The HTML
A simple div, with the contenteditable set to true:
<div id='bioEntryContainer' contenteditable='true' class='form-control'></div>
The CSS
The form-control is from Twitter's Bootstrap CSS. The custom styles are:
#bioEntryContainer { min-height:74px; overflow:auto; }
Attempts to Fix
I've tried the following with CSS, with no luck:
overflow:hidden;
overflow-x:hidden;
white-space:nowrap;
white-space:pre;
display:inline-block;
I've tried the route suggested in this question, but it didn't work. Any other suggestions?
Update
I created a fiddle to demo the problem, but I can't recreate it there. I've included the Bootstrap CSS to get it as close to the actual environment as possible.
The div is added in the Bootstrap Modal with JS. I'm not sure how that could change things, but hopefully that provides more background information.

Which IE versions have you tried so far?
I've tried it in IE 9-11 and no such problem persists.
Try setting
word-wrap:break-word;
in your css style.

Related

Styling the height of a input type='file' element in chrome

I have a html form input of type file:
<input type='file' />
I am aware of the styling limitation around this element and the workarounds (parent div, hidden field with click events etc) if you want some custom styling on it, which is not what I'm looking for.
My issue is pretty simple, if I apply height to the element, IE and Firefox set the element height just like all other input types, but chrome is ignoring the height attribute.
input{
height:50px;
}
Here is a jsfiddle
Is there away to get chrome to honor the height. Seems a simple thing but adding !important or adding the height inline doesn't make a difference.
N.b. there are LOADS of question about styling a file input on SO, but none address getting the height attribute to be honored in chrome. It works fine in other browsers.
I'm also aware that increasing the font size will make the input bigger, however its not an attractive solution.
Is setting height now possible in chrome?
This is how chrome understands it with pseudo code-
PseudoCode css
I have updated my link-
input[type="file"]{
height:50px;
}
input[type="file"]::-webkit-file-upload-button{
height:50px;
}
find the changes- http://jsfiddle.net/xfv0otLL/3/

<style> tag in header.php in WordPress not working in IE 8

I have following code in header.php file on a WP theme :
<style type="text/css">
#Subheader{display:none;}
</style>
This code hides a div with id="Subheader" which works fine in Chrome and Firefox, but not in IE 8. When I look at source code in IE, the code is there, but its not hiding the div.
Also I have similar code :
<style type="text/css">
#Footer, .lwa-submit-links {display:none;}
</style>
in a page from wp-admin page editor, which should hide the footer div when that page is opened. Again its not working in IE.
Any Help would be appreciated.
This sounds exceedingly like a long standing bug in IE, whereby trying to hide an element using display:none didn't work if it's parent container was already display none. When the parent was re-shown, the child also became visible even though it was still display:none.
The problem is described and demoed in an interesting site: Position is Everything, about browser bugs. The full link for this problem is http://www.positioniseverything.net/explorer/ienondisappearcontentbugPIE/index.htm.
However it was apparently a thing which affects IE in Compatibility mode (set from Tools/Compatibility settings); I don't know if you happen to be running in that mode? Even if not it might be well worth while playing around with the sequence you set things to display none to see if that will fix your problem.

IE and Div heights

Site in question:
http://www.sedulity.tk/
Site using Chrome 19 dev:
Site using IE9:
as you can see on the homepage using IE it seems like it not recognizing the height of the DIV of each picture, whereas on chrome and firefox there is no issue.
I think this is probably my fault, won't blame IE for it...but I can't figure it out :|
In your css folder there is a css file ie7style.css and it's being used for ie (I've tested in ie8) and it has a class (.item-image) that is
.item-image{
height:142px;
}
Try to fix it or just remove it.
Css file: http://www.sedulity.tk/wp-content/themes/DeepFocus/css/ie7style.css
See in this developer Tool screenshot I've removed the css entry height:142px from class (.item-image) from file ie7style.css
After that (without .item-image{height:142px} in file ie7style.css) see the page in ie8
Try adding a height to the .item
CSS
#portfolio-items .item {
height:500px;
}
you might wanna check this article for a cross-browser inline-block that doesn't overlap. your case is most likely caused by the "baseline", where the next set of elements base their tops on the last elements' baseline (which would be somewhere in the middle of the element).

IE9 link hover css color change vertical shift

IE 9 on Hover over a link, pushes some of the HTML down the page.
When i remove the color from
td.subarea > h2 > a:hover { color: #aa051a; text-decoration: none;}
the problem does not occur.
I can't paste all the code here, and fairly sure its a unique problem to this page.
But maybe someone out there has seen something similar.
Its not moving the Link(a tag) down the page, its the whole containing table that moves.
This problem seems to occur in IE9 when the container element is set to overflow: auto and there is some hover action taking place in the child element.
There is a very simple solution of adding min-height: 0px to the container element, which works.
The detailed explanation of the bug and this solution can be found in this link:
http://blog.brianrichards.net/post/6721471926/ie9-hover-bug-workaround
Make sure your line-height and font-size properties are the same for normal and hover.
Sort of found the problem, well makes the table stop moving. margin-top:-20px.
Although it olny shifted down about 10px.
Probably some IE9 rendering issue. IE7/8 actually move the table on intial loading.
The font sizes, line-heights, all that css, is all good for the link.
Marc B is probably close to the issue of IE rendering something wrong and cauing floats and such to mess up.
Now have to real style a table layout wihtin a table layout page(ugh, hate table layout).
For me I had to specify
height:100%;
Then I had to go ahead and specify
width:100%;
The 'min-height: 0px' by mohitp above got me on the right track.

Checkbox and dropdown arrows invisible in chrome

For some reason my checkboxes and dropdown arrows are not visible in chrome, however, they still work.
They are perfectly visible in IE. When I load the page in IE, then try loading the page in chrome, they usually appear until I refresh the page again in chrome.
Anyone know what the problem might be?
Reference image: http://i.imgur.com/Q66w6.png
A 'solution' to this Chrome problem is to
open Task Manager
refresh the page in Chrome while the Taks Manager is open in front of the browser.
I couldn't believe this would actually work when I read about it, but I've seen it with my very eyes. This issue apparently exists since the early versions of Chrome and still exists in current versions, though it only occasionally occurs. It seems to be permanently gone after this 'fix'.
In webkit browsers the following code will remove dropdown arrows.
select{
-webkit-appearance:none;
}
Checking in your browsers inspector will indicate if it's being applied in your case or not.
Found this question while having the same problem.
Setting:
input {
width:100%
}
was the cause of the problem for me. This:
input[text] {
width:100%
}
was what I wanted (leave checkbox widths unchanged) -- setting the width of checkboxes in chrome seems to make them disappear.
As user48956 mentioned; setting input width to 100% causes checkboxes to vanish in chrome.
I use bootstrap and often have forms where I want all inputs to stretch 100% and don't want to use bootstraps form methods and this issue still comes up.
If you have defined input {width:100%} you can put a width on the div containing the checkbox and it will fix. e.g.
<div style="display:inline-block; width:20px"><input type="checkbox" name="read_privacy_policy" id="read_privacy_policy" class="pull-left"></div>
<div style="display:inline-block">I have read and understand the Privacy Policy.*</div>
or you can set style="width:auto" on the input itself
I had the same issue
Try this css style supression all style that acts in the input checkbox element.
-webkit-appearance: checkbox!important;
I think it's a bug and it's still there. I use checkboxes in a ligthbox window and they don't show. I'm on OS-X using Chrome 21.