div+css布局实现铅笔效果代码

代码语言:html

所属分类:布局界面

代码描述:div+css布局实现铅笔效果代码

代码标签: div css 布局 铅笔 代码

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

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

<head>
  <meta charset="UTF-8">

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

body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  gap: 25vh;
}

.pencil {
  height: 40px;
  background-image: linear-gradient(#f19d00 20%, #c77003 20% 80%, #9e5501 80%);
  position: relative;
}
.pencil--short {
  width: 12.5%;
}
.pencil--long {
  width: 50%;
}
.pencil::before, .pencil::after {
  position: absolute;
  height: 100%;
  width: 64px;
}
.pencil::before {
  content: "";
  .........完整代码请登录后点击上方下载按钮下载查看

网友评论0