내 창에 세로축으로 응답하고 수직으로 이미지를 중심에 놓고 싶습니다. 그래서 div 배경에 이미지를 통합하기로 결정했습니다. 이제 스트로크 - 대시 오프셋 및 스트로크 - 대시 오프셋을 사용하여 스트로크 - 대시 어레이 및 애니메이션을 내 SVG에 추가하려고하면 작동하지 않습니다.svg "background-image"에 애니메이션을 적용 할 수 있습니까?
SVG 배경 이미지에 애니메이션을 적용 할 수 있습니까?
svg 이미지는 여러 줄로 구성됩니다. 여기 내 SVG 파일 (만 다른 x와 y 값을 훨씬 더 라인이 있습니다) : 여기
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1920 1200" xml:space="preserve">
<g id="Layer_1">
<line class="path" stroke-linecap="round" fill="none" stroke="#FFFFFF" stroke-width="3" stroke-miterlimit="10" x1="960" y1="600" x2="2346.139" y2="-42.064"/>
</g>
</svg>
그리고 내 HTML과 CSS 파일 :
html, body {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
background-color: red;
}
.Container {
position: relative;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 100%;
height: 100%;
background-image: url(Space.svg);
background-size: cover;
background-position: center;
}
.path {
stroke-dasharray: 20;
}
<body>
<div class="Container">
</div>
</body>
이보고 https://github.com/jrummyapps/AnimatedSvgView –
/검색 Q = 가치가있다 svg + animate + transform 또는/search? p = svg + animate + transform 검색하셨습니까? :) –
CSS를 컨테이너 HTML 파일이나 별도의 CSS 파일이 아닌 SVG 이미지 파일 자체에 넣어야합니다. –