当前位置: 首页 > article >正文

CSS浮雕效果

效果图:

HTML源码:

<!DOCTYPE html>
<html lang="en">
<head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
</head>
<body>
        

<form>
        <div class="segment">
          <h1>Sign Up</h1>
        </div>
        <label>
          <input type="text" placeholder="Username" />
        </label>
        <label>
          <input type="password" placeholder="Password" />
        </label>
        <button class="red" type="button" title="Login"> Log in <svg t="1730280552580" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5041" width="16" height="16" style="vertical-align: middle;"><path d="M409.002667 469.333333L300.8 361.130667 361.130667 300.8l211.2 211.2-211.2 211.2-60.330667-60.330667L409.002667 554.666667H128v-85.333334h281.002667zM469.333333 128h341.333334c46.933333 0 85.333333 38.4 85.333333 85.333333v597.333334c0 46.933333-38.4 85.333333-85.333333 85.333333h-341.333334v-85.333333h341.333334V213.333333h-341.333334V128z" fill="#ae1100" p-id="5042"></path></svg></button>

        <div class="input-group">
          <label>
            <input type="text" placeholder="Register By Email" />
          </label>
          <button class="unit" type="button" title="Register"><svg t="1730281008926" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6135" width="16" height="16"><path d="M722.6 645.295c17.497-26.999 9.793-63.072-17.206-80.567-21.997-14.255-45.104-26.406-69.045-36.377 69.66-51.387 114.937-134.006 114.937-227.013 0-155.467-126.483-281.951-281.951-281.951s-281.951 126.483-281.951 281.951c0 92.95 45.223 175.527 114.811 226.919-51.763 21.557-99.309 53.261-140.153 94.103-82.080 82.080-127.284 191.213-127.284 307.292 0 32.174 26.082 58.254 58.254 58.254s58.254-26.080 58.254-58.254c0-175.385 142.685-318.068 318.068-318.068 61.579 0 121.298 17.606 172.699 50.915 27.002 17.498 63.074 9.793 80.567-17.206zM469.334 135.897c91.225 0 165.442 74.218 165.442 165.442s-74.218 165.442-165.442 165.442c-91.225 0-165.442-74.217-165.442-165.442s74.218-165.442 165.442-165.442z" p-id="6136" fill="#ae1100"></path><path d="M926.63 743.197h-66.992v-66.992c0-32.174-26.080-58.254-58.254-58.254s-58.254 26.080-58.254 58.254v66.992h-66.992c-32.174 0-58.254 26.080-58.254 58.254s26.080 58.254 58.254 58.254h66.992v66.992c0 32.174 26.080 58.254 58.254 58.254s58.254-26.080 58.254-58.254v-66.992h66.992c32.174 0 58.254-26.080 58.254-58.254s-26.080-58.254-58.254-58.254z" p-id="6137" fill="#ae1100"></path></svg></button>
        </div>
      </form>


<style>
        body,
html {
  background-color: #ebecf0;
}

body,
p,
input,
select,
textarea,
button {
  font-family: "Montserrat", sans-serif;
  letter-spacing: -0.2px;
  font-size: 16px; /* $ruler: 16px */
}

div,
p {
  color: #babecc; /* $color-shadow */
  text-shadow: 1px 1px 1px #fff; /* $color-white */
}

form {
  width: 320px; /* $ruler * 20 */
  margin: 0 auto;
}

.segment {
  padding: 32px 0; /* $ruler * 2 */
  text-align: center;
}

button,
input {
  border: 0;
  outline: 0;
  font-size: 16px; /* $ruler */
  border-radius: 320px; /* $ruler * 20 */
  padding: 16px; /* $ruler */
  background-color: #ebecf0; /* $color-bg */
  text-shadow: 1px 1px 0 #fff; /* $color-white */
}

label {
  display: block;
  margin-bottom: 24px; /* $ruler * 1.5 */
  width: 100%;
}

input {
  margin-right: 8px; /* $ruler / 2 */
  box-shadow: inset 2px 2px 5px #babecc, inset -5px -5px 10px #fff; /* $color-shadow, $color-white */
  width: 100%;
  box-sizing: border-box;
  transition: all 0.2s ease-in-out;
  appearance: none;
  -webkit-appearance: none;
}

input:focus {
  box-shadow: inset 1px 1px 2px #babecc,
    inset -1px -1px 2px #fff; /* $color-shadow, $color-white */
}

button {
  color: #61677c;
  font-weight: bold;
  box-shadow: -5px -5px 20px #fff, 5px 5px 20px #babecc; /* $color-white, $color-shadow */
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  font-weight: 600;
}

button:hover {
  box-shadow: -2px -2px 5px #fff, 2px 2px 5px #babecc; /* $color-white, $color-shadow */
}

button:active {
  box-shadow: inset 1px 1px 2px #babecc,
    inset -1px -1px 2px #fff; /* $color-shadow, $color-white */
}

.button .icon {
  margin-right: 8px; /* $ruler / 2 */
}

button.unit {
  border-radius: 8px; /* $ruler / 2 */
  line-height: 0;
  width: 48px; /* $ruler * 3 */
  height: 48px; /* $ruler * 3 */
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin: 0 8px; /* $ruler / 2 */
  font-size: 19.2px; /* $ruler * 1.2 */
}

button.unit .icon {
  margin-right: 0;
}

button.red {
  display: block;
  width: 100%;
  color: #ae1100; /* $color-red */
  margin: 32px 0;
}

.input-group {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.input-group label {
  margin: 0;
  flex: 1;
}

</style>

</body>
</html>

相关参考:cssinspirationguide - csc inspiration guide onlinecsc inspiration guide onlineicon-default.png?t=O83Ahttps://csscoco.com/inspiration/#/./shadow/relief-style-btn


http://www.kler.cn/a/373069.html

相关文章:

  • Unreal Engine 5 C++(C#)开发:使用蓝图库实现插件(二)编辑BPLibrary.h中的枚举及结构体
  • paimon实战 -- Changelog Producer到底有什么用?
  • 对话瀚荃:为何欧美拟统一采用USB-C充电接口?
  • AES_ECB算法C++与Java相互加解密Demo
  • 1Panel应用商店开源软件累计下载突破200万次!
  • 算法工程师重生之第三十九天(不同的子序列 两个字符串的删除操作 编辑距离 编辑距离总结篇 )
  • C++: String容器的使用和实现
  • 【MySQL】日志
  • QT中使用图表之QChart概述
  • 排查公网NAT网关中高流量ECS实例
  • 想要分离人声,来试试看这几个方法
  • 使用PE工具箱进行系统安装
  • 企业新闻及产品宣传稿怎么写?有哪些商业财经类报纸杂志或媒体发布?
  • 串口扫盲TTL,TX/TR/GND
  • 统计数据集的TXT、XML及JSON标注文件中各类别/每个标签的数量
  • threejs开源实例-粒子地球
  • ElasticSearch 入门需要了解的概念
  • 【模型学习之路】手写+分析Transformer
  • 2024第二次随堂测验参考答案
  • 【C++】——高效构建与优化二叉搜索树
  • docker容器和宿主机端口映射
  • Linux 命令行学习:数据流控制、文本处理、文件管理与自动化脚本 (第二天)
  • Python Requests 的高级使用技巧:应对复杂 HTTP 请求场景
  • 《达梦》达梦数据库安装步骤(VMware16+麒麟 10+DM8)
  • 中小企业设备维护新策略:Spring Boot系统设计与实现
  • Tauri(一)——更适合 Web 开发人员的桌面应用开发解决方案 ✅