gpt4 book ai didi

html - 如何改变鼠标移动的渐变位置?

转载 作者:行者123 更新时间:2023-11-28 08:40:21 26 4
gpt4 key购买 nike

我正在尝试在网站上建立更多的用户交互。由于我的网站有渐变,我的灵感来自于渐变如何随着鼠标悬停在事物网站上而移动 http://www.impossible-bureau.com/ .

如果有人能帮我写一个代码来做同样的背景效果就太好了!

最佳答案

请参阅此快速 Fiddle 示例,不涉及 JS(您将需要做很多工作才能拥有像它们一样光滑美观的东西,但我在后台看不到任何移动 :) 只有前景有不同的状态):

*
{
margin: 0;
padding: 0;
box-sizing: border-box;
}

html, body {
height: 100%;
}

body {
background-image: url(http://upload.wikimedia.org/wikipedia/commons/4/49/Zdiar1.jpg);
background-size: 100% 100%;
color: white;
font-size: 1.5rem;
font-family: "Segoe UI";
}

div
{
background-color: darkblue;
height: 100%;
width: 25%;
float: left;
padding: 1rem;
transition: .5s ease;
}

div:nth-of-type(4)
{
background-color: darkblue;
}

div:hover
{
background-color: transparent;
}
<div>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laudantium ipsa vitae quidem quod soluta vel impedit eligendi eius minus quis optio recusandae numquam iure laborum voluptatum facilis cum similique excepturi.</div>
<div>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laudantium ipsa vitae quidem quod soluta vel impedit eligendi eius minus quis optio recusandae numquam iure laborum voluptatum facilis cum similique excepturi.</div>
<div>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laudantium ipsa vitae quidem quod soluta vel impedit eligendi eius minus quis optio recusandae numquam iure laborum voluptatum facilis cum similique excepturi.</div>
<div>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laudantium ipsa vitae quidem quod soluta vel impedit eligendi eius minus quis optio recusandae numquam iure laborum voluptatum facilis cum similique excepturi.</div>

关于html - 如何改变鼠标移动的渐变位置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27833924/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com