简体   繁体   English

如何在Textarea容器中设置文本样式?

[英]How to Style text in Textarea Container?

I have a textarea tag in My modal for editing. 我的模态中有一个textarea标签,可以进行编辑。

When I want to show my note in textarea, it shows text in center of the textarea box. 当我想在文本区域中显示我的笔记时,它会在文本区域框的中央显示文本。

I try text-alighn,direction and float,also I tried to put my note in p tag,but I does not work. 我尝试使用text-alighn,direction和float,也尝试将便笺放在p标签中,但是我不起作用。

all that I do,is shown I picture. 我所做的一切,都显示在图片中。 在此处输入图片说明

How can i fix this problem? 我该如何解决这个问题?

Can you try to add dir="rtl" to the div wrapper of the textarea : 您可以尝试将dir="rtl"添加到textareadiv包装器中吗:

<div dir="rtl">
    <textarea></textarea>
</div>

this CSS code can align your text from the right for Farsi 该CSS代码可以使您的文本从右侧对齐以显示波斯语

   textarea {
        white-space: normal;
        text-align: right;
        -moz-text-align-last: right; /* Firefox 12+ */
        text-align-last: right;
        direction: rtl;
    }

and your HTML can be like this 您的HTML可以像这样

<div id="wrap">

  <textarea class="area" col="2" row="5">این نوشته از راست است.</textarea>
</div>
   use text-align:left !important
   or float:left !important

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM