2013-07-10 55 views
3
<textarea class="skinCondition-field vlongtext clear ui-input-text ui-body-d ui-corner-all ui-shadow-inset" type="text" placeholder="Update details of your present skin condition (e.g. normal, dry, flaky, etc). Optionally, add details of any past skin conditions, medication or skin treatments/surgeries undergone. You may also upload images/reports, so that doctors understand your condition better." value=""></textarea> 

CSS:佔位符文本切得到一個textarea內

textarea.ui-input-text.skinCondition-field { 
    height:10.5em; 
    white-space: normal; 
    word-wrap: break-word; 
    display: block;  
    word-wrap: break-word !important; 
    white-space: normal!important; 
    width: 100%; 
} 

甚至試圖

textarea.ui-input-text.skinCondition-field::-webkit-input-placeholder {white-space: normal!important; word-break: break-all !important;word-wrap: break-word !important;} 

但在星系S3中的問題仍然存在。

+0

你解決了這個問題嗎? – Wayou

回答

0

我不知道,但嘗試刪除您的類,然後嘗試

<textarea type="text" placeholder="Update details of your present skin condition (e.g. normal, dry, flaky, etc). Optionally, add details of any past skin conditions, medication or skin treatments/surgeries undergone. You may also upload images/reports, so that doctors understand your condition better." value=""></textarea> 
+0

:(不工作 – Sara

1

看看this FIDDLE幫助。 !

點擊上面的鏈接。

textarea.ui-input-text.skinCondition-field { 
    height:10.5em; 
    white-space: normal; 
    word-wrap: break-word; 
    display: block;  
    word-wrap: break-word !important; 
    white-space: normal!important; 
    width: 100%; 
} 

編輯: 在這裏,在這種情況下,提問者需要多行佔位符! 你可以得到相同的,這樣說:

#text1::-webkit-input-placeholder::after { 
    display:block; 
    content:"Line 2\A Line 3"; 
} 



#text2::-webkit-input-placeholder{ 
    color:transparent; 
} 

#text2::-webkit-input-placeholder::before { 
    color:#666; 
    content:"Line 1\A Line 2\A Line 3\A"; 
} 

雖然佔位符文本,只能短距離的提示!因此,使用<title>代替更長的文本。

+0

小提琴可以,但仍然不能在s3中工作 – Sara

+0

試着將默認的''標籤替換爲: '' – MAST3RMIND

+0

仍然不能正常工作,但它在Android 2.3.3中工作正常,但在版本4.1 0.2 – Sara

1
$('textarea') 
    .addClass('placeholder') 
    .each(function() { 
     $(this).val($(this).attr('placeholder')); 
    }) 

$('textarea').bind({ 
    'focus': function() { 
     var placeholder = $(this).attr('placeholder'); 
     $(this) 
      .removeClass('placeholder'); 

     if ($(this).val() == placeholder) { 
      $(this).val(''); 
     } 
    }, 
    'blur': function() { 
     var placeholder = $(this).attr('placeholder'); 

     if ($(this).val() == '') { 
      $(this) 
       .val(placeholder) 
       .addClass('placeholder'); 
     } 
    } 
});