javascript - Svg 元素在容器外时隐藏

标签 javascript html css animation svg

我想将一个 svg 元素 移到它的 container 之外,但它是隐藏的。我启用了overflow: visible还是没弄清楚问题。

我用 figma 创建了 svg。 剪辑内容被禁用

这里有 code &一个photo以便更好地看到问题。

最佳答案

此 SVG 代码可能会有帮助...以完整 View 打开此代码段..

/** Animation Boxes (Moving on cursor move) **/
.showcase-animation-container {
	position: absolute;
	right: 350px;
	width: 500px;
	height: 500px;

	svg {
		position: absolute;
		top: 0;
		left: 0;
		overflow: visible !important;
		width: 100%;
		height: 100%;
	}
}

.left-triangle { transform-origin: center center }

.left-triangle {
	transform: translate(-180px, -70px) rotate(-50deg);
	fill: red;
}
<div class="showcase-animation-container">
 <svg width="736" height="589" viewBox="-80 0 556 589" fill="none" xmlns="http://www.w3.org/2000/svg">
  <g filter="url(#filter0_f)" style="
   /* margin-left: 180px; */
   ">
   <path class="left-triangle" d="M12.6269 323.5L130 82.9806L247.373 323.5H12.6269Z" stroke="black" stroke-width="7"></path>
   <path d="M389.373 265.5L272 506.019L154.627 265.5H389.373Z" stroke="black" stroke-width="7"></path>
   <path d="M308.627 323.5L426 82.9806L543.373 323.5H308.627Z" stroke="black" stroke-width="7"></path>
  </g>
  <defs>
   <filter id="filter0_f" x="-180" y="-7" width="736" height="589" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
    <feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood>
    <feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend>
    <feGaussianBlur stdDeviation="3.5" result="effect1_foregroundBlur"></feGaussianBlur>
   </filter>
  </defs>
 </svg>
</div>

关于javascript - Svg 元素在容器外时隐藏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58057692/

相关文章:

javascript - 使用 jQuery 在文本框中按 Enter 键

javascript - 使用 RabbitMq 和 websockets 扩展应用程序

html - CSS float 左问题

javascript - 错误的偏移量();在 Firefox 上

css - 为什么 @screen xl 和 @screen lg 在 tailwindcss 中被 @screen md 覆盖?

javascript - Outlook Rest Api — 获取特定时区的日历 View (REST)

javascript - 重新计算 arrangedContent

html - 在 CSS 中的横幅中实现类似箭头的形状

javascript - 选择菜单项时如何播放html5播放器的视频?

php - 如何在 Wordpress 中将帖子特色图片设置为背景图片