div+css布局实现响应式大气护肤类自适应企业商城官网代码

代码语言:html

所属分类:响应式

代码描述:div+css布局实现响应式大气护肤类自适应企业商城官网代码

代码标签: div css 布局 响应式 大气 护肤 自适应 企业 商城 官网 代码

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

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

<head>
 
<meta charset="UTF-8">
 
 
 
 
<style>
:root {
  --primary: #1a7b88;
  --primary-light: #75c6d1;
  --secondary: #f6c90e;
  --dark: #2d3436;
  --light: #f8f9fa;
  --text: #333333;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  --radius: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Montserrat', 'Segoe UI', sans-serif;
}

body {
  background-color: var(--light);
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

nav {
  background-color: white;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--primary);
  text-decoration: none;
}

.nav-links {
  display: grid;
  grid-template-columns: repeat(5, auto);
  gap: 30px;
  justify-content: center;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-cart {
  position: relative;
}

.cart-icon {
  background-color: var(--primary);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: var(--secondary);
  color: var(--dark);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

.hero {
  background: linear-gradient(to right, rgba(26, 123, 136, 0.9), rgba(26, 123, 136, 0.7)), url('/api/placeholder/1600/900');
  background-size: cover;
  background-position: center;
  color: white;
  padding: 100px 0;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.hero-text h1 {
  font-size: 3rem;
  margin-bottom: 20px;
  line-height: 1.2;
}

.hero-text p {
  font-size: 1.1rem;
  margin-bottom: 30px;
  opacity: 0.9;
}

.cta-button {
  display: inline-block;
  background-color: var(--secondary);
  color: var(--dark);
  padding: 12px 30px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: bold;
  transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: var(--shadow);
}

.cta-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.hero-image img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.featured {
  padding: 80px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 50px;
}

.section-header h2 {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 15px;
}

.section-header p {
  max-width: 600px;
  margin: 0 auto;
  color: #666;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.product-card {
  background-color: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
}

.product-image {
  height: 250px;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

.product-info {
  padding: 20px;
}

.product-tag {
  display: inline-block;
  background-color: var(--primary-light);
  color: white;
  font-size: 0.8rem;
  padding: 5px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}

.product-title {
  font-size: 1.2rem;
  margin-bottom: 5px;
  color: var(--dark);
}

.product-price {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
}

.price {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--primary);
}

.add-to-cart {
  background-color: var(--secondary);
  color: var(--dark);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.3s;
}

.add-to-cart:hover {
  background-color: #e0b70f;
}

.benefits {
  background-color: white;
  padding: 80px 0;
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  margin-top: 40px;
}

.benefit-card {
  text-align: center;
  padding: 30px 20px;
  border-r.........完整代码请登录后点击上方下载按钮下载查看

网友评论0