css - 同时在左侧格式化一些文本,在右侧格式化一些文本

标签 css arabic

我检查了prior posts仍然无法正常工作。您如何在同一行上将文本的翻译左右对齐?我同时使用阿拉伯语和英语。考虑尝试使用表格和一些 CSS,但如何使用?

<table width="100%"><tr><td height="30px">
3) What services do you provide?
</td>
<td class="arabic">
ما هي الخدمات التي تقدّمها؟
</td></tr></table>

3) 你们提供什么服务? ما هي الخدمات التي تودّمها؟

最佳答案

要从右到左显示文本,您可以使用 direction属性(property)。

Set the direction CSS property to match the direction of the text: rtl for languages written from right-to-left (like Hebrew or Arabic) text and ltr for other scripts.

.arabic {
  direction: rtl;
}
<table width="100%">
  <tr>
    <td height="30px">
      3) What services do you provide?
    </td>
    <td class="arabic">
      ما هي الخدمات التي تقدّمها؟
    </td>
  </tr>
</table>

您还可以使用 float 使文本呈现在右侧。

.arabic {
  float: right;
}
<table width="100%">
  <tr>
    <td height="30px">
      3) What services do you provide?
    </td>
    <td class="arabic">
      ما هي الخدمات التي تقدّمها؟
    </td>
  </tr>
</table>

关于css - 同时在左侧格式化一些文本,在右侧格式化一些文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32070694/

相关文章:

html - 将图像宽度设置为半页宽度

java - 我想使用 pdfbox 显示 pdf 中的阿拉伯语文本?

mysql - 使用 codeigniter 插入和选择阿拉伯语

html - 每个屏幕尺寸的最大高度 - bootstrap

css - 样式表对 html 没有影响(但 Bootstrap 样式有效)

java - 在 Android 中将阿拉伯语文本转换为 UTF8

java - Android ListView 中的阿拉伯文字

swift - 使用阿拉伯语键盘的 TextField 数字输入

javascript - 仅当某个 div 的高度大于设置高度时才显示 div?

javascript - 如何遍历兄弟元素