如何将文本限制为html/css-重叠图像中的各节和文本下方
我正在尝试通过30DEG
使用转换:旋转
。
但是它与上面的视频重叠。
我如何仅限于文本以保持在框(红色框)下方。
感谢您的任何帮助。
#type-graphy{
display: flex;
white-space: nowrap;
font-size: 100px;
text-shadow: 0 0 120px #0f0;
text-align: center;
transform: rotate(30deg);
}
span{
position: relative;
z-index: 2;
font-size: 80px;
color: black;
padding: 0 2px;
user-select: none;
cursor: default;
transition: 1s;
white-space: nowrap;
-webkit-text-stroke: 1px #0f0;
opacity: 20%;
}
<section class="alpha-mate">
<div class="banner" >
<img class="mask" src="mask.png" alt="mask">
<video class="vid1" src="vid2.mp4" type="mp4" muted autoplay loop> </video>
<!-- <img class="img2" src="img3.jpg" alt=""> -->
<p class="main-text">Happy birthday</p>
</div>
</section>
<section class="type-graphy" id="type-graphy" >
<div class="name">
<span>C</span>
<span>a</span>
<span>m</span>
<span>r</span>
<span>e</span>
<span>n</span>
<span> </span>
<span>B</span>
<span>i</span>
<span>c</span>
<span>o</span>
<span>n</span>
<span>d</span>
<span>o</span>
<span>a</span>
</div>
I'm trying to rotate my text by 30deg
by using transform:rotate
.
But it overlaps with video above.
How can I limit the text to stay below the box(red-box) only.
Thanks for any help from your side.
#type-graphy{
display: flex;
white-space: nowrap;
font-size: 100px;
text-shadow: 0 0 120px #0f0;
text-align: center;
transform: rotate(30deg);
}
span{
position: relative;
z-index: 2;
font-size: 80px;
color: black;
padding: 0 2px;
user-select: none;
cursor: default;
transition: 1s;
white-space: nowrap;
-webkit-text-stroke: 1px #0f0;
opacity: 20%;
}
<section class="alpha-mate">
<div class="banner" >
<img class="mask" src="mask.png" alt="mask">
<video class="vid1" src="vid2.mp4" type="mp4" muted autoplay loop> </video>
<!-- <img class="img2" src="img3.jpg" alt=""> -->
<p class="main-text">Happy birthday</p>
</div>
</section>
<section class="type-graphy" id="type-graphy" >
<div class="name">
<span>C</span>
<span>a</span>
<span>m</span>
<span>r</span>
<span>e</span>
<span>n</span>
<span> </span>
<span>B</span>
<span>i</span>
<span>c</span>
<span>o</span>
<span>n</span>
<span>d</span>
<span>o</span>
<span>a</span>
</div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)