小编The*_*mer的帖子

CSS 旋转文本垂直 - 两侧的额外空间

当我使用 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)

html css rotation css-animations

5
推荐指数
2
解决办法
3318
查看次数

Textarea&nbsp; alert()转换为Space

我有一个textarea,我插入4行,&nbsp;当我alert()输出它将它转换为空格时,jQuery中是否有任何显示为它的函数并保持相同?预期的输出应该与我添加到textarea相同而不转换&nbsp;为空格.

jSFiddle:https://jsfiddle.net/s4kjpLqg/

regex jquery

1
推荐指数
1
解决办法
429
查看次数

从字符串中删除第一次出现的 &lt;p&gt;

下面是代码

 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)

regex jquery

1
推荐指数
1
解决办法
1459
查看次数

标签 统计

jquery ×2

regex ×2

css ×1

css-animations ×1

html ×1

rotation ×1