css布局实现一个快递包装盒子效果代码

代码语言:html

所属分类:布局界面

代码描述:css布局实现一个快递包装盒子效果代码

代码标签: 一个 快递 包装 盒子 效果

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


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

<head>

  <meta charset="UTF-8">

  
  
  
<style>
.package-background {
  box-sizing: border-box;
  display: inline-block;
  background: linear-gradient(45deg, rgba(0, 0, 0, 0.09) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.09) 75%, rgba(0, 0, 0, 0.09) 0), linear-gradient(45deg, rgba(0, 0, 0, 0.09) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.09) 75%, rgba(0, 0, 0, 0.09) 0), white;
  background-position: 0 0, 10px 10px;
  background-size: 20px 20px;
  outline: 1px solid #ddd;
  outline-offset: 1px;
  padding-left: 48px;
  padding-top: 30px;
  width: 100vw;
  height: 100vh;
}

.package-container {
  width: 338.1px;
  height: 322px;
  perspective: 1000px;
}
.package-container .package {
  font-size: 4em;
  margin: auto;
  width: 230px;
  transform-style: preserve-3d;
  transform: translateX(-3px) rotateX(-22deg) rotateY(25deg);
}
.package-container .package .side {
  position: absolute;
  background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTAgMTAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEwIDEwOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHN0eWxlIHR5cGU9InRleHQvY3NzIj4uc3Qwe2ZpbGw6dXJsKCNTVkdJRF8xXyk7fTwvc3R5bGU+PGxpbmVhckdyYWRpZW50IGlkPSJTVkdJRF8xXyIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIHgxPSIyIiB5MT0iNSIgeDI9IjgiIHkyPSI1Ij48c3RvcCAgb2Zmc2V0PSIwIiBzdHlsZT0ic3RvcC1jb2xvcjojNEIwMDAwO3N0b3Atb3BhY2l0eTowIi8+PHN0b3AgIG9mZnNldD0iMC41IiBzdHlsZT0ic3RvcC1jb2xvcjojNEIwMDAwO3N0b3Atb3BhY2l0eTowLjA1Ii8+PHN0b3AgIG9mZnNldD0iMSIgc3R5bGU9InN0b3AtY29sb3I6IzRCMDAwMDtzdG9wLW9wYWNpdHk6MCIvPjwvbGluZWFyR3JhZGllbnQ+PHJlY3QgeD0iMiIgY2xhc3M9InN0MCIgd2lkdGg9IjYiIGhlaWdodD0iMTAiLz48L3N2Zz4=);
  border: 1px solid #b89a6c;
  outline: 1px solid transparent;
}
.package-container .package .side.front {
  width: 230px;
  height: 300px;
  background-color: #D1B386;
  background-size: 7px 7px;
  transform: translateZ(80px);
}
.package-container .package .side.front::before {
  content: "";
  position: absolute;
  height: 4px;
  background: rgba(0, 0, 0, 0.3);
  top: 50%;
  left: 0;
  right: 0;
  margin-top: -2px;
  z-index: -1;
}
.package-container .package .side.front::after {
  content: "";
  position: absolute;
  height: 60px;
  background: rgba(84, 43, 25, 0.7);
  top: 50%;
  left: -1px;
  right: 0;
  margin-top: -30px;
  z-index: -1;
}
.package-container .package .side.top {
  width: 230px;
  height: 160px;
  background-color: #c5a678;
  background-size: 8px 8px;
  transform: rotateX(90deg) translateZ(80px);
}
.package-container .package .side.left {
  width: 160px;
  height: 300px;
  background-color: #b89a6c;
  background-size: 12px 12px;
  transform: rotateY(-90deg) translateZ(80px);
}
.package-container .package .side.left::after {
  content: "";
  position: absolute;
  height: 60px;
  background: rgba(84, 43, 25, 0.7);
  top: 50%;
  left: 40%;
  right: -1px;
  margin-top: -30px;
}
.package-container .package .side.right {
  width: 160px;
  height: 300px;
  transform: translateX(230px) rotateY(90deg) translateZ(-80px);
}
.package-container .package .side.bottom {
  width: 230px;
  height: 160px;
  transform: translateY(300px) rotateX(-90deg) translateZ(-80px);
}
.package-container .package .side.back {
  width: 230px;
  height: 300px;
  transform: rotateY(-180deg) translateZ(80px);
}

.label {
  font-family: Segoe UI, Arial, Sans-Serif;
  font-size: 0.7rem;
  font-weight: 600;
  color: #333;
  box-sizing: border-box;
  margin: 30px;
  width: calc(100% - 60px);
  height: calc(100% - 60px);
  background: rgba(255, 255, 255, 0.95);
  padding: 5px;
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
  border-radius: 2px;
}
.label ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.label ul li {
  margin: 0;
  padding: 0;
}
.label .border {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  border: 1px solid #ccc;
}
.label .header,
.label .barcodes {
  box-sizing: border-box;
  padding: 5px;
  border-bottom: 1px solid #ccc;
  display: flex;
  justify-content: space-around;
}
.label .header {
  height: 25px;
}
.label .barcodes {
  height: 50px;
}
.label .royal-mail-logo {
  width: 50%;
  height: 99px;
  background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgNDQ1LjggODkuMiIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgNDQ1LjggODkuMjsiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+LnN0MHtmaWxsOiNDQ0NDQ0M7fTwvc3R5bGU+PGc+PHBhdGggY2xhc3M9InN0MCI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