svg+css实现上传表单美化效果代码

代码语言:html

所属分类:表单美化

代码描述:svg+css实现上传表单美化效果代码

代码标签: 表单 美化 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">


  
  
<style>
*, *:after, *:before {
  box-sizing: border-box;
}

:root {
  --c-action-primary: #2e44ff;
  --c-action-primary-accent: #e9e5ff;
  --c-action-secondary: #e5e5e5;
  --c-text-primary: #0d0f21;
  --c-text-secondary: #6a6b76;
  --c-background-primary: #d0d1de;
}

body {
  font-family: "Inter", sans-serif;
  color: var(--c-text-primary);
  background-color: var(--c-background-primary);
  line-height: 1.5;
}

input, button, select, textarea {
  font: inherit;
}

.modal {
  width: 90%;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  margin-top: 10vh;
  margin-bottom: 10vh;
  background-color: #FFF;
  border-radius: .5rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.modal-header {
  display: -webkit-box;
  display: flex;
  -webkit-box-align: start;
          align-items: flex-start;
  -webkit-box-pack: justify;
          justify-content: space-between;
  padding: 1.5rem 1.5rem 1rem;
}

.logo-circle {
  width: 3.5rem;
  height: 3.5rem;
  display: -webkit-box;
  display: flex;
  -webkit-box-pack: center;
          justify-content: center;
  -webkit-box-align: center;
          align-items: center;
  border-radius: 50%;
  background-color: var(--c-action-primary-accent);
}
.logo-circle svg {
  max-width: 1.5rem;
}

.btn-close {
  display: -webkit-box;
  display: flex;
  -webkit-box-align: center;
          align-items: center;
  -webkit-box-pack: center;
          justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: .25rem;
  border: none;
  background-color: transparent;
}
.btn-close:hover, .btn-close:focus {
  background-color: var(--c-action-primary-accent);
}

.modal-body {
  padding: 1rem 1.5rem;
}

.modal-title {
  font-weight: 700;
}

.modal-description {
  color: var(--c-text-secondary);
}

.upload-area {
  margin-top: 1.25rem;
  border: none;
  background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' stroke='%23ccc' stroke-width='3' stroke-dasharray='6%2c 14' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");
  background-color: transparent;
  padding: 3rem;
  width: 100%;
  display: -webkit-box;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
          flex-direction: column;
  -webkit-box-align: center;
          align-items: center;
}
.upload-area:hover, .upload-area:focus {
  background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' stroke='%232e44ff' stroke-width='3' stroke-dasharray='6%2c 14' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");
}

.upload-area-icon {
  display: block;
  width: 2.25rem;
  height: 2.25rem;
}
.upload-area-icon svg {
  max-height: 100%;
  max-width: 100%;
}

.upload-area-title {
  margin-top: 1rem;
  display: block;
  font-weight: 700;
  color: var(--c-text-primary);
}

.upload-area-description {
  display: block;
  color: var(--c-text-secondary);
}
.upload-area-description strong {
  color: var(--c-action-primary);
  font-weight: 700;
}

.modal-footer {
  padding: 1rem 1.5rem 1.5rem;
  display: -webkit-box;
  display: flex;
  -webkit-box-pack: end;
          justify-content: flex-end;
}
.modal-footer [class*="btn-"] {
  margin-left: .75rem;
}

.btn-secondary, .btn-primary {
  padding: .5rem 1rem;
  font-weight: 500;
  border: 2px solid var(--c-action-secondary);
  border-radius: .25rem;
  background-color: transparent;
}

.btn-primary {
.........完整代码请登录后点击上方下载按钮下载查看

网友评论0