css+js实现可调边框宽度与边角样式的按钮效果代码
代码语言:html
所属分类:表单美化
代码描述:css+js实现可调边框宽度与边角样式的按钮效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum=1.0,minimum=1.0,user-scalable=0" /> <style> body { min-height: 100vh; display: grid; place-content: center; font-size: clamp(2rem, 1rem + 5vw, 4rem); } .button { --background-color: white; --border-color: linear-gradient(to bottom right, red, blue); --border-width: 0.5em; --edge-size: 0.5em; cursor: pointer; background: var(--background-color); padding: 0.5em 1.5em; border: 0; position: relative; isolation: isolate; display: inline-grid; place-content: center; -webkit-clip-path: polygon(var(--edge-size) 0%, 100% 0, 100% calc(100% - var(--edge-size)), calc(100% - var(--edge-size)) 100%, 0 100%, 0% var(--edge-size)); .........完整代码请登录后点击上方下载按钮下载查看
网友评论0