简体   繁体   English

我怎样才能把一个圆圈的 SVG 图像放在网页的底部,以一种你一直只能看到上半部分的方式

[英]How can i take an SVG image of a circle and put it at the bottom of the webpage, in a way that you can only see the top half all the time

I want to make the circle image spin so you only see the top half as it spins and the user cant scroll down to see the other half, while not adding scroll bars due to scale increase of the image or width/height.我想让圆形图像旋转,因此您只能在旋转时看到上半部分,而用户无法向下滚动以查看另一半,同时由于图像或宽度/高度的比例增加而不会添加滚动条。 Example can this be done with CSS or java?示例可以使用 CSS 或 java 完成吗?

This can be pretty easily accomplished by creating an absolutely positioned overflow-hidden wrapper, and adding a spin animation to an element inside the wrapper.这可以很容易地通过创建一个绝对定位的溢出隐藏包装器,并将旋转 animation 添加到包装器内的元素来完成。

 .spinner { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); overflow: hidden; height: calc(50vw / 2); }.spinner img { animation: spin 5s linear infinite; width: 50vw; border-radius: 100%; } @keyframes spin { from {transform:rotate(0deg);} to {transform:rotate(360deg);} }
 <div class="spinner"> <img src="https://picsum.photos/200"> </div>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM