【问题标题】:Another weird behavior of css How to fix it?css 的另一个奇怪行为如何解决?
【发布时间】:2022-07-26 00:29:49
【问题描述】:

css 的另一个奇怪行为:

我有这个结构,显然我应该得到强标签ltr和p标签rtl中的其他所有内容:

p {
     direction: rtl; 
}

strong {
    direction: ltr !important;
}
<p>
<strong>This should be to right side. این باید سمت راست باشد</strong>
</p>

但它忽略了强标签的样式 - 我该如何解决这个问题?

【问题讨论】:

    标签: html css


    【解决方案1】:

    这应该可以帮助你:

    p {
         direction: rtl; 
    }
    
    p > strong {
        direction: ltr !important;
    }
    <p>
    <strong>This should be to right side. این باید سمت راست باشد</strong>
    </p>

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-10-21
      • 2023-04-01
      • 2016-03-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-25
      相关资源
      最近更新 更多