首页 > 解决方案 > 从左到右到从右到左转换 - 输入

问题描述

我编写了一个输出为 [What is] 1的代码,我希望它是 [What should be] 2我该怎么做?应该在哪里编辑?

我编写了一个输出为 [What is] 1的代码,我希望它是 [What should be] 2我该怎么做?应该在哪里编辑?

    .prt-pricing-detial {
        display: table;
        text-align: right;
        width: 100%;
        margin-bottom: 25px;
    }
    .pricing-heading {
        font-family: "Mr Eaves XL Modern", "Helvetica Neue", Helvetica, Arial, sans-serif;
        font-style: normal;
        font-weight: normal;
        line-height: normal;
        font-size: 16px;
        color: #000000;
        vertical-align: middle;
        display: table-cell;

    }
    .pricing-profit {
        display: inline-block;
        text-align: center;
        height: 42px;
        font-size: 18px;
        width: 120px;
        text-indent: 8px;
    }
    .prt-pricing-name {
        text-align:center;
        font-weight: 600;
        font-size: 18px;
        margin-bottom: 20px;
    }


           
       <div class="prt-pricing-content">
                            <div class="prt-pricing-name"><span></span></div>
                            <div class="prt-pricing-detial">
                              <span class="pricing-heading">سود شما:</span><div class="pricing-field">
                              <input class="pricing-profit" type="number" value="25.00" disabled="">           

标签: htmlcss

解决方案


使用 CSS direction:rtl

.row-reverse {

        direction: rtl;

}

Direction属性指定块级元素内的文本方向/书写方向。
Direction有一个 4 值

direction: ltr|rtl|initial|inherit;

所以我只给这个问题2

  • ltr =文本方向从左到右- 默认
  • rtl =文本方向从右到左

会得到这样的输出

.row-reverse {
    
            direction: rtl;
}

.prt-pricing-detial {
  display: table;
  text-align: right;
  width: 100%;
  margin-bottom: 25px;
}

.pricing-heading {
  font-family: "Mr Eaves XL Modern", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-style: normal;
  font-weight: normal;
  line-height: normal;
  font-size: 16px;
  color: #000000;
  vertical-align: middle;
  display: table-cell;
}

.pricing-profit {
  display: inline-block;
  text-align: center;
  height: 42px;
  font-size: 18px;
  width: 120px;
  text-indent: 8px;
}

.prt-pricing-name {
  text-align: center;
  font-weight: 600;
  font-size: 18px;
  margin-bottom: 20px;
}
<div class="prt-pricing-content row-reverse">
  <div class="prt-pricing-name"><span></span></div>
  <div class="prt-pricing-detial">
    <span class="pricing-heading">سود شما:</span>
    <div class="pricing-field">
      <input class="pricing-profit" type="number" value="25.00" disabled="">


推荐阅读