div+css实现锥形渐变彩虹按钮效果代码
代码语言:html
所属分类:布局界面
代码描述:div+css实现锥形渐变彩虹按钮效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> @import url("https://fonts.googleapis.com/css2?family=Inter:wght@400"); body { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 100vh; background-color: #242424; font-family: "Inter", sans-serif; } .button { all: unset; position: relative; border: 1px solid rgba(0, 0, 0, 0.36); border-radius: 8px; padding: 8px 16px; font-size: 16px; background-color: #d8d8d8; -webkit-mask-image: -webkit-radial-gradient(#fff, #000); /* another workaround */ mask-image: radial-gradient(#fff, #000); cursor: pointer; } .button.dark { border-color: rgba(255, 255, 255, 0.12); background-color: #2b2b2b; color: #dcdadb; } .button::after { content: ""; position: absolute; top: var(--y); left: var(--x); transform: translate(-50%, -50%); .........完整代码请登录后点击上方下载按钮下载查看
网友评论0