如何在樣式中input
標籤佔位符擴展該父類型,並且我想在left
中輸入right direction
樣式的輸入。HTML更換佔位符方向
例如,這是我輸入:
<input type="password" style='direction:ltr;text-align:left;' id="password" placeholder="password">
佔位現在的text-align留下。如何使用direction:rtl
?
如何在樣式中input
標籤佔位符擴展該父類型,並且我想在left
中輸入right direction
樣式的輸入。HTML更換佔位符方向
例如,這是我輸入:
<input type="password" style='direction:ltr;text-align:left;' id="password" placeholder="password">
佔位現在的text-align留下。如何使用direction:rtl
?
我認爲這可以幫到你。
input[type="text"]:-moz-placeholder {
text-align: right;
}
input[type="text"]:-ms-input-placeholder {
text-align: right;
}
input[type="text"]::-webkit-input-placeholder {
text-align: right;
}
根據該文檔:(http://www.w3.org/html/wg/drafts/html/master/forms.html#the-placeholder-attribute)
在控制的內容具有一個方向性但 佔位符需要具有不同方向性的情況下,統一的 雙向算法格式化字符可以在所使用的 屬性值:
或者你可以做它的重點:
input[type='text']{
text-align:right;
}
input[type='text']:focus{
text-align:left;
}
雖然這不完全是你問什麼,似乎因爲許多瀏覽器如Firefox 3和IE更好的給我8,9不支持改變佔位符的風格。 From this answer