如何将文本限制为html/css-重叠图像中的各节和文本下方

发布于 2025-01-26 16:25:49 字数 2007 浏览 2 评论 0原文

我正在尝试通过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.

here is the image.

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

终陌 2025-02-02 16:25:49
    <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>Camren Bicondova</span>
    </div>
#type-graphy{
    font-size: 100px;
    text-shadow: 0 0 120px #0f0;
    border:1px solid black;  
    overflow:hidden; // Use this feature to hide text when rotated
}

.name
{
  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%;
    letter-spacing:20px; // You don't need to put every letter in an element, it is enough to add this feature
}
    <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>Camren Bicondova</span>
    </div>
#type-graphy{
    font-size: 100px;
    text-shadow: 0 0 120px #0f0;
    border:1px solid black;  
    overflow:hidden; // Use this feature to hide text when rotated
}

.name
{
  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%;
    letter-spacing:20px; // You don't need to put every letter in an element, it is enough to add this feature
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文