Html+css actual combat 198 area layout

Front end ballad 2022-06-23 18:15:35 阅读数:584

html+csshtmlcssactualcombat

         index.css

.banner {
height: 500px;
background-color: #f5f5f5;
}
.banner .wrapper {
position: relative;
height: 500px;
background-color: pink;
}
/* Side navigation */
.banner .aside {
position: absolute;
left: 0;
top: 0;
width: 250px;
height: 500px;
background-color: rgba(0,0,0,.8);
}
.banner .aside li {
height: 50px;
line-height: 50px;
}
.banner .aside a {
position: relative;
/* The width is the same as the parent */
padding-left: 36px;
padding-right: 19px;
display: block;
height: 50px;
color: #fff;
}
.banner .aside a:hover {
background-color: #27ba9b;
}
/* a Add an arrow at the last position inside the */
.banner .aside a::after {
position: absolute;
right: 19px;
top: 19px;
content: '';
width: 6px;
height: 11px;
background-image: url(../images/sprites.png);
background-position: -80px -110px;
}
/* arrow */
.next,
.prev {
position: absolute;
top: 228px;
width: 45px;
height: 45px;
background-color: rgba(0,0,0,.2);
background-image: url(../images/sprites.png);
border-radius: 50%;
}
/* The location of the background map is responsible for 2 thing : Change the position of the arrow in the box ; Change the position of the sprite map */
/* Resulting in inaccurate dimensions measured in the sprite diagram */
/* The solution is 2 Kind of :
1. Write the location attribute of the background map , Use Google's debugging tool to debug specific location values
2. When writing labels , a In charge of the box , Add another span Responsible for arrow
*/
.prev {
left: 260px;
background-position: 14px -60px;
}
.next {
right: 10px;
background-position: -23px -60px;
}
/* Dot */
.banner ol {
position: absolute;
left: 680px;
bottom: 30px;
height: 10px;
}
.banner ol li {
float: left;
margin-right: 24px;
width: 10px;
height: 10px;
background-color: rgba(255, 255, 255, 0.4);
border-radius: 50%;
cursor: pointer;
}
.banner ol .current {
background-color: #fff;
}
/* Fresh good things */
.goods .hd {
height: 114px;
line-height: 114px;
}
.goods .hd h2 {
float: left;
font-size: 29px;
font-weight: 400;
height: 114px;
}
.goods .hd h2 span {
margin-left: 34px;
font-size: 16px;
color: #999;
}
.goods .hd a,
.shengxian .hd .more {
float: right;
color: #999;
}
.goods .hd a::after,
.shengxian .hd .more::after {
content: '';
display: inline-block;
margin-left: 13px;
width: 7px;
height: 13px;
background-image: url(../images/sprites.png);
background-position: 0 -110px;
vertical-align: middle;
}
.goods .bd li {
position: relative;
float: left;
margin-right: 8px;
width: 304px;
height: 405px;
background-color: #f0f9f4;
text-align: center;
}
.goods .bd li:last-child {
margin-right: 0;
}
.goods .bd li img {
width: 304px;
}
.goods .bd li h3 {
margin-top: 20px;
margin-bottom: 10px;
font-size: 20px;
font-weight: 400;
}
.goods .bd li div {
color: #9a2e1f;
font-size: 17px;
}
.goods .bd li div span {
font-size: 23px;
}
.goods .bd li b {
position: absolute;
left: 17px;
top:18px;
width: 28px;
height: 51px;
border: 1px solid #27ba9b;
border-radius: 2px;
font-size: 18px;
color: #27ba9b;
font-weight: 400;
line-height: 24px;
}
/* fresh */
.shengxian .hd {
height: 96px;
line-height: 96px;
}
.shengxian .hd h2 {
float: left;
font-size: 29px;
font-weight: 400;
}
.shengxian .hd .more {
float: right;
}
.shengxian .hd ul {
float: right;
margin-right: 65px;
}
.shengxian .hd ul li {
float: left;
}
.shengxian .hd li a {
padding: 2px 7px;
margin-left: 6px;
}
.shengxian .hd li a:hover {
background-color: #27ba9b;
color: #fff;
}
.shengxian .bd .left {
float: left;
width: 240px;
height: 610px;
background-color: pink;
}
.shengxian .bd .right {
float: left;
width: 1000px;
height: 610px;
background-color: skyblue;
}

Running results

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> Project code preparation </title>
<!-- Generation of external linked style sheets -->
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="./css/base.css">
<link rel="stylesheet" href="./css/common.css">
<link rel="stylesheet" href="./css/index.css">
</head>
<body>
<!-- Quick navigation -->
<div class="shortcut">
<div class="wrapper">
<ul>
<li><a href="#"> Please log in first </a></li>
<li><a href="#"> Free registration </a></li>
<li><a href="#"> My order </a></li>
<li><a href="#"> Membership Center </a></li>
<li><a href="#"> Help center </a></li>
<li><a href="#"> Online Service </a></li>
<li><a href="#"><span></span> Mobile phone version </a></li>
</ul>
</div>
</div>
<div class="header wrapper">
<div class="logo">
<h1><a href="#"> Rabbit Xianer </a></h1>
</div>
<div class="nav">
<ul>
<li><a href="#"> home page </a></li>
<li><a href="#"> fresh </a></li>
<li><a href="#"> food </a></li>
<li><a href="#"> Kitchen </a></li>
<li><a href="#"> Electrical appliances </a></li>
<li><a href="#"> Home </a></li>
<li><a href="#"> Wash and protect </a></li>
<li><a href="#"> Pregnancy and infant </a></li>
<li><a href="#"> clothing </a></li>
</ul>
</div>
<div class="search">
<input type="text" placeholder=" Search for ">
<!-- location Magnifier -->
<span></span>
</div>
<div class="car">
<span>2</span>
</div>
</div>
<!-- banner -->
<div class="banner">
<div class="wrapper">
<!-- How many pictures are there , There are all less li -->
<ul>
<li>
<a href="#"><img src="./uploads/banner_1.png" alt=""></a>
</li>
</ul>
<!-- Side navigation -->
<div class="aside">
<ul>
<li><a href="#"> fresh <span> Fruits vegetables </span></a></li>
<li><a href="#"> fresh <span> Fruits vegetables </span></a></li>
<li><a href="#"> fresh <span> Fruits vegetables </span></a></li>
<li><a href="#"> fresh <span> Fruits vegetables </span></a></li>
<li><a href="#"> fresh <span> Fruits vegetables </span></a></li>
<li><a href="#"> fresh <span> Fruits vegetables </span></a></li>
<li><a href="#"> fresh <span> Fruits vegetables </span></a></li>
<li><a href="#"> fresh <span> Fruits vegetables </span></a></li>
<li><a href="#"> fresh <span> Fruits vegetables </span></a></li>
<li><a href="#"> fresh <span> Fruits vegetables </span></a></li>
</ul>
</div>
<!-- arrow -->
<!-- prev: the previous -->
<a href="#" class="prev"></a>
<!-- next : next -->
<a href="#" class="next"></a>
<!-- Dot : current state : current / active -->
<!-- js Find the user clicked li Add class name li Turn white -->
<ol>
<li></li>
<li></li>
<li class="current"></li>
<li></li>
<li></li>
</ol>
</div>
</div>
<!-- Fresh good things -->
<div class="goods wrapper">
<!-- hd header Head -->
<div class="hd">
<h2> Fresh good things <span> Fresh out The quality is reliable </span></h2>
<a href="#"> Check all </a>
</div>
<!-- body The body , Content -->
<div class="bd clearfix">
<ul>
<li>
<a href="#">
<img src="./uploads/new_goods_1.jpg" alt="">
<h3> Remy wireless vacuum cleaner F8</h3>
<div>¥<span>899</span></div>
<b> New product </b>
</a>
</li>
<li>
<a href="#">
<img src="./uploads/new_goods_1.jpg" alt="">
<h3> Remy wireless vacuum cleaner F8</h3>
<div>¥<span>899</span></div>
<b> New product </b>
</a>
</li>
<li>
<a href="#">
<img src="./uploads/new_goods_1.jpg" alt="">
<h3> Remy wireless vacuum cleaner F8</h3>
<div>¥<span>899</span></div>
</a>
</li>
<li>
<a href="#">
<img src="./uploads/new_goods_1.jpg" alt="">
<h3> Remy wireless vacuum cleaner F8</h3>
<div>¥<span>899</span></div>
</a>
</li>
</ul>
</div>
<div class="bd clearfix">
<div class="left">
<a href="#"><img src="./uploads/fresh_goods_cover.png" alt=""></a>
</div>
<div class="right"></div>
</div>
</div>
<!-- fresh -->
<div class="shengxian wrapper">
<div class="hd">
<h2> fresh </h2>
<a href="#" class="more"> Check all </a>
<ul>
<li><a href="#"> Fruits </a></li>
<li><a href="#"> Fruits </a></li>
<li><a href="#"> Fruits </a></li>
<li><a href="#"> Fruits </a></li>
<li><a href="#"> Fruits </a></li>
<li><a href="#"> Fruits </a></li>
<li><a href="#"> Fruits </a></li>
</ul>
</div>
<div class="bd clearfix">
<div class="left">
<a href="#"><img src="./uploads/fresh_goods_cover.png" alt=""></a>
</div>
<div class="right"></div>
</div>
</div>
<!-- Copyright area -->
<div class="footer">
<div class="wrapper">
<div class="top">
<ul>
<li>
<!-- Add labels through pseudo elements to realize the wizard diagram -->
<span> The price is close to the people </span>
</li>
<li>
<span> Fast logistics </span>
</li>
<li>
<span> Fresh quality </span>
</li>
</ul>
</div>
<div class="bottom">
<p>
<a href="#"> About us </a> |
<a href="#"> Help center </a> |
<a href="#"> After-sales service </a> |
<a href="#"> Delivery and acceptance </a> |
<a href="#"> Business cooperation </a> |
<a href="#"> Search recommendations </a> |
<a href="#"> link </a>
</p>
<p>CopyRight @ Rabbit Xianer </p>
</div>
</div>
</div>
</body>
</html>

Running results

版权声明:本文为[Front end ballad]所创,转载请带上原文链接,感谢。 https://qdmana.com/2022/174/202206231649015212.html