图片中的零件切断

发布于 2025-02-08 06:46:44 字数 916 浏览 1 评论 0原文

我是个新手。我遇到了这个问题。 las,我没有在网上找到明确的答案,所以我决定转到这里。 任务是我需要彼此叠加图片,以便在2号屏幕截图中看起来像,即我们有一个黄色的点覆盖层,以及需要裁剪的完整尺寸图像。 据我所知,我尝试了一切。我寻求帮助,不要扔西红柿。提前感谢

示例代码(html,css):

   <p class="card">
       <img class="one" src="/" alt="123">
       <img class="two" src="/" alt="123">
   </p>

.card {
  position: relative;
  z-index: 10;
  width: 100%;
}

.one {
  position: absolute;
  width: 350px;
  top: 50px;
  left: 55px;
  z-index: 5;

}

.two {
  position: absolute;
  width: 350px;
  left: 20px;
  top: 25px;
  z-index: 2;
}

“糟糕的尝试”

I'm a total newbie. And I ran into this problem. Alas, I did not find a definite answer on the net, so I decided to turn here.
The task is that I need to overlay the pictures on top of each other, so that it looks like in screenshot No. 2, i.e. we have a yellow spot overlay, and a full size image that needs to be cropped.
From what I know, I've tried everything. I ask for help and do not throw tomatoes. Thanks in advance

Example code (html, css):

   <p class="card">
       <img class="one" src="/" alt="123">
       <img class="two" src="/" alt="123">
   </p>

.card {
  position: relative;
  z-index: 10;
  width: 100%;
}

.one {
  position: absolute;
  width: 350px;
  top: 50px;
  left: 55px;
  z-index: 5;

}

.two {
  position: absolute;
  width: 350px;
  left: 20px;
  top: 25px;
  z-index: 2;
}

bad try
example

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

装纯掩盖桑 2025-02-15 06:46:44

使用掩码图像属性像该形状和使用位置一样掩盖:绝对和进一步

 -webkit-mask-image: url(---.png);    //use the image shape to mask
 mask-image: url(---.png);
-webkit-mask-size: 70%;
mask-size: 70%;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat; 

Use mask image property to mask like that shape and use position:absolute and do Further

 -webkit-mask-image: url(---.png);    //use the image shape to mask
 mask-image: url(---.png);
-webkit-mask-size: 70%;
mask-size: 70%;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat; 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文