【问题标题】:Controlling position of the CSS mirrored text控制 CSS 镜像文本的位置
【发布时间】:2019-06-01 22:10:50
【问题描述】:

使用this 问题的答案中的代码我设法镜像了文本,但现在它超出了正常文本的流程。

<style>
span.flip {
        display: block;
        -moz-transform: scaleX(-1); /* Gecko */
        -o-transform: scaleX(-1); /* Operah */
        -webkit-transform: scaleX(-1); /* webkit */
        transform: scaleX(-1); /* standard */
        filter: FlipH; /* IE 6/7/8 */
    }
</style>

<p>Some text <span class="flip">mirror</span> and more tex</p>

如何防止镜像文本脱离正常文本流?哪些属性控制镜像文本的位置?

【问题讨论】:

标签: html css webkit flip mirroring


【解决方案1】:

添加display: inline-block; 这将在一行中完成:

<style>
span.flip {
        display: inline-block;
        -moz-transform: scaleX(-1); /* Gecko */
        -o-transform: scaleX(-1); /* Operah */
        -webkit-transform: scaleX(-1); /* webkit */
        transform: scaleX(-1); /* standard */
        filter: FlipH; /* IE 6/7/8 */
    }
</style>

<p>Some text <span class="flip">mirror</span> and more text</p>​

如果你想在不同的行上,使用这个:

<style>
span.flip {
        display: block;
        -moz-transform: scaleX(-1); /* Gecko */
        -o-transform: scaleX(-1); /* Operah */
        -webkit-transform: scaleX(-1); /* webkit */
        transform: scaleX(-1); /* standard */
        filter: FlipH; /* IE 6/7/8 */
        width: 36px; 
    }
</style>

<p>Some text <span class="flip">mirror</span> and more text</p>​

【讨论】:

  • 它不能解决我的问题。镜像文本仍然会中断普通文本的流动 - 普通文本在一行中,镜像文本在其下一行。
  • 哦...对不起,我不明白你的意思,我现在就去处理。
猜你喜欢
  • 2010-11-12
  • 2011-02-04
  • 1970-01-01
  • 1970-01-01
  • 2015-01-03
  • 2010-09-30
  • 1970-01-01
  • 2011-03-26
  • 1970-01-01
相关资源
最近更新 更多