Jump to content

content editable problems in chrome,mozilla and seamonkey


shadiadiph

Recommended Posts

I have been trying to make a div with contenteditable have ironed out sevral cross browser problems already but am having the following problems

 

1) when i click in the editable area in chrome there is no initial caret (cursor) until I type something.

2) On mozilla and seamonkey the caret (cursor) initially appears to be the same height as the div until I type.

 

Any ideas??

 

CSS

#editabletxt{   
width:500px; 
height:100px;
text-align:left;
font-size:80%;
font-weight:normal;   
background:#fff;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;    
border: 1px solid #dbe1e6;
padding: 4px 4px 4px 4px;
}
.editortext{
width:500px; 
height:100px;
line-height:150%;
display:block;
overflow:auto;
outline: 0px solid transparent;
word-wrap: break-word;
white-space:pre; 
}

 

 

HTML

<div id="editabletxt" name="editabletxt" class="editortext" contenteditable="true"><div></div></div>

 

if you are wondering why there is an empty div in the main div its a hack for IE to stop it including double line breaks.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.