当我使用 TEXT 旋转和内联图层时,它会在旋转时增加额外的空间(大文本的宽度),我不想修复。使用 CSS 旋转时,避免两侧额外空间(元素宽度)的最佳方法是什么。
下面是我的代码:
.rotate {
display: inline-block;
white-space: nowrap;
transform: translate(0, 100%) rotate(-90deg);
transform-origin: 0 0;
vertical-align: bottom;
}
.rotate:before {
content: "";
float: left;
margin-top: 100%;
}
.rotate:after {
content: "";
display: inline-block;
}Run Code Online (Sandbox Code Playgroud)
<div style="display:inline-block; position:relative;" class="rotate">
<span style="displock;width:100%;font-size: 55px;color: #222222;opacity: 0.15;white-space: nowrap;">BACKGROUND</span>
<span style="display:block;width:100%;font-size: 45px;color: #222222;text-align:center;">TITLE</span>
</div>
Some randome text here should be close to the rotated element Some randome text here should be close to the rotated element Some randome text here should …Run Code Online (Sandbox Code Playgroud)我有一个textarea,我插入4行, 当我alert()输出它将它转换为空格时,jQuery中是否有任何显示为它的函数并保持相同?预期的输出应该与我添加到textarea相同而不转换 为空格.
jSFiddle:https://jsfiddle.net/s4kjpLqg/
下面是代码
var str = '<p>first occurrence</p> can have multiple lines of ln or new line code etc <p>another p</p> and then again <p>another code in p </p>';
Run Code Online (Sandbox Code Playgroud)
正则表达式或简单 jquery 的预期结果:
first occurrence can have multiple lines of ln or new line code etc <p>another p</p> and then again <p>another code in p </p>
Run Code Online (Sandbox Code Playgroud)