css制作简易购物网页

效果展示:
在这里插入图片描述
制作头部:
在这里插入图片描述
html

<header>
    <ul>
        <li class="logo"><img src="images/logo.jpg"></li>
        <li><a href="#">穿搭速递</a> </li>
        <li><a href="#">穿搭速递</a> </li>
        <li><a href="#">穿搭速递</a> </li>
        <li><a href="#">穿搭速递</a> </li>
        <li><a href="#">穿搭速递</a> </li>
        <li><a href="#">穿搭速递</a> </li>
    </ul>
</header>

css

*{
    margin: 0px;
    padding: 0px;
}
header{
    width: 980px;
    height: 70px;
    background-color: antiquewhite;
    border-bottom: 3px solid pink;
    margin: 0 auto;
}
header ul{
    width: 980px;
    margin: 0 auto;
    list-style-type: none;/*去除无序列表的·*/
}
header li{
    float: left;
}
header ul img{
    width: 135px;
    height: 100px;
    margin-right: 40px;
    margin-left: -10px;
    border-radius: 50px;
}
header li a{
    display: inline-block;
    height: 70px;
    text-decoration: none;/*去除下划线*/
    line-height: 70px;
    width: 120px;
    text-align: center;
    color: hotpink;
}
header li a:hover{
    color: darkorange;
    font-size: 20px;
}

随后是一张图片:
在这里插入图片描述
制作内容部分:
在这里插入图片描述
html:

<div class="content">
    <div class="banner"><img src="images/banner.jpg"></div>
    <div class="style_bg">
        <div class="style">
        <dl>
            <dt class="left1"></dt><dd class="left2"><a href="#">明星风尚</a> </dd>
            <dt class="left3"></dt><dd class="left4"><a href="#">时尚博主</a> </dd>
        </dl>
        <dl>
            <dt class="center1"></dt><dd class="center2"><a href="#">流行搭配</a></dd>
            <dt class="center3"></dt><dd class="center4"><a href="#">精选秀场</a></dd>
        </dl>
            <dl class="third">
                <dt class="right1"></dt><dd class="right2"><a href="#">环球街拍</a></dd>
            </dl>
        </div>
    </div>
</div>

css

.content{
    width: 980px;
    margin: 0 auto;
}
.content .style_bg{
    width: 908px;
    height: 330px;
    background-color: darkorange;
    padding: 10px 36px 5px;
}
.banner img{
    width: 980px;
    height: 300px;
    margin-bottom: 20px;
}
.style{
    width: 892px;
    height: 314px;
    background-color: #ffffff;
    padding: 8px 10px 8px 6px;
}
.style dl{
    width: 279px;
    height: 313px;
    float: left;
    margin-left: 4px;
}
.style .third{
    width: 322px;
}
.style dt,.style dd{
    float: left;
}
.style .left1,.style .left3,.style .center1,.style .center3{
    width: 162px;
}
.style .left2,.style .left4,.style .center2,.style .center4,.style .right2{
    width: 117px;
}
.style .left1,.style .left2,.style .center1,.style .center2{
    margin-bottom: 8px;
}
.style .left1{
    height: 169px;
    background: url("../images/1.jpg") no-repeat;
    background-size: 100% 100%;
}
.style .left2{
    height: 169px;
    line-height: 169px;
}
.style .left3{
    height: 137px;
    background: url("../images/2.jpg") no-repeat;
    background-size: 100% 100%;
}
.style .left4{
    height: 137px;
    line-height: 137px;
}
.style .center1{
    height: 169px;
    background: url("../images/3.jpg") no-repeat;
    background-size: 100% 100%;
}
.style .center2{
    height: 169px;
    line-height: 169px;
}
.style .center3{
    height: 137px;
    background: url("../images/4.jpg") no-repeat;
    background-size: 100% 100%;
}
.style .center4 {
    height: 137px;
    line-height: 137px;
}
.style .right1{
    height: 314px;
    width: 190px;
    background: url("../images/5.jpg");
    background-size: 100% 100%;
}
.style .right2{
    height: 314px;
    line-height: 314px;
}
.style a{
    display: block;
    text-align: center;
    background-color: antiquewhite;
    color: #ec6e47;
    text-decoration: none;
}
.style a:hover{
    background-color: pink;
    font-size: 20px;
}

制作购物内容部分:
在这里插入图片描述
html

 <h2 class="title">时尚前沿/Tidal Current</h2>
    <div class="current">
        <div class="sale">
          <a href="#"><img src="images/1.2.jpg"></a>
          <div class="price">&yen;588</div>
          <a href="#" class="introduce">it UNDER GARDEN男连帽拉链冲锋衣2018春夏新品7205XAA</a>
          <div class="salemount"><span>销售量:10</span></div>
          <div class="rate">评价:6</div>
          <div class="buy"><a href="#">立即抢购</a></div>
        </div>
        <div class="sale">
          <a href="#"><img src="images/1.2.jpg"></a>
          <div class="price">&yen;588</div>
          <a href="#" class="introduce">it UNDER GARDEN男连帽拉链冲锋衣2018春夏新品7205XAA</a>
          <div class="salemount"><span>销售量:10</span></div>
          <div class="rate">评价:6</div>
          <div class="buy"><a href="#">立即抢购</a></div>
        </div>
        <div class="sale">
            <a href="#"><img src="images/1.2.jpg"></a>
            <div class="price">&yen;588</div>
            <a href="#" class="introduce">it UNDER GARDEN男连帽拉链冲锋衣2018春夏新品7205XAA</a>
            <div class="salemount"><span>销售量:10</span></div>
            <div class="rate">评价:6</div>
            <div class="buy"><a href="#">立即抢购</a></div>
        </div>
    </div>

css:

 /*h2标题*/
        .title{
            font-family: 楷体;
            color: white;
            display: block;
            background-color: #ec6e47;
            margin-top: 20px;
            margin-left: 117px;
            width: 275px;
            height: 50px;
            line-height: 50px;
        }
        /*总体*/
        .current{
            height: 542px;
            width: 957px;
            background-color: #FCF;
            padding: 10px 36px 5px;
            position: relative;
            margin: 0 auto;
        }
        /*第一个div*/
        .current .sale{
              margin: 20px 8px 0px;
              width: 260px;
              height: 458px;
              padding: 20px;
              background-color: white;
              border: 1px solid darkorange;
              float: left;
          }
        .current img{
            width: 253px;
            height: 278px;
        }
        /*价格*/
        .current .price{
            color: red;
            font-weight: bold;
        }
        /*介绍*/
        .current .introduce{
            color: deepskyblue;
            font-weight: normal;
            text-decoration: none;
            font-family: 汉仪柳楷繁;
            display: block;
            margin: 10px auto;
        }
        /*销售量*/
        .current .salemount{
            float: left;
            height: 20px;
            font-size: smaller;
            width: 120px;
            border-right:#CCC solid 1px;
            line-height: 20px;
            margin-bottom: 6px;
            margin-left: 10px;
        }
        /*评价*/
        .current .rate{
            float: left;
            color: darkorange;
            height: 20px;
            line-height: 20px;
            font-size:18px;
            margin-left: 20px;
            margin-bottom: 20px;
        }
        .current .buy{
            clear: both;
            height: 20px;
            line-height: 20px;
            width: 145px;
            text-align: center;
            padding: 5px 0px;
            margin: 0px auto;
            background-color: darkorange;
            border-radius: 30px;
            border: 2px solid red;
        }
        .current .buy a{
            color: white;
            text-decoration: none;
        }
        .current .buy:hover{
            background-color:coral;
            font-size:large;
            cursor:pointer;
        }
        .current .introduce:hover{
            text-decoration: underline;
        }
  • 35
    点赞
  • 199
    收藏
    觉得还不错? 一键收藏
  • 24
    评论
### 回答1: 好的,制作一个简单的购物网站需要以下步骤: 1. 设计网站的布局和风格,包括网站的颜色、字体、图片等。 2. 使用HTML语言编写网站的结构,包括头部、导航栏、主体内容、底部等。 3. 使用CSS语言为网站添加样式,包括字体、颜色、布局等。 4. 使用JavaScript语言为网站添加交互功能,比如购物车、商品搜索、商品分类等。 5. 在后台添加商品信息和价格等,以便用户可以浏览和购买商品。 6. 最后进行测试和优化,确保网站的功能和性能都能够满足用户的需求。 以上就是用HTML、CSS、JavaScript制作一个简单购物网站的基本步骤。 ### 回答2: 制作一个简单购物网站需要使用HTML、CSS和JS三种技术进行开发。首先需要设计网站的基本结构,比如网站的首页、商品列表页面、商品详情页面等等。接着需要使用HTML来编写网站的静态页面,包括文字、图片、链接等元素。CSS用于美化网站的样式,比如颜色、字体、布局等。JS用于实现网站的交互功能,比如添加到购物车、结算、登录等。 网站的首页需要设计精美的轮播图,展示商品的照片及名称,吸引用户的眼球。商品列表页面需要呈现出所有的商品,可以采用分页的方式进行展示,每个商品需要包含照片、名称、价格、库存等信息。商品详情页面需要呈现出商品的详细信息,包括多张照片、商品名称、价格、描述、库存等等。 购物网站必须有购物车功能,方便用户添加、查看、删除商品。通过JS实现购物车功能需要使用数组来存储商品信息,使用localStorage来存储购物车中商品的信息,对于购物车的操作需要实现添加、删除、展示等等。此外,网站需要实现用户登录、退出功能,以及订单管理等。 制作一个简单购物网站需要一定的前端技术,需要注重设计和用户体验,同时也需要注重用户隐私保护和安全性。可以借鉴其他成熟购物网站的设计,同时也需要注意网站的性能优化,提高网站的访问速度和响应能力,使用户的体验更加良好。 ### 回答3: 制作一个简单购物网站需要掌握HTML、CSS、JS等知识,同时需要具备网页设计的基本能力。以下是制作简单购物网站的步骤: 1. 页面布局设计:首先要设计网站的布局,需考虑到网站主题和用户需求,确定好各个模块的位置、大小及内容。 2. 编写HTML:网页由HTML元素构成。根据页面布局设计,利用HTML语言编写HTML页面结构,包括头部、主体、底部等。 3. 应用样式:通过CSS样式对网页进行美化,使其更符合用户的审美习惯。CSS样式主要设置文字颜色、背景、边框等。 4. JS交互效果:利用JS编写页面的交互效果,如加入购物车、计算价格等。这些交互效果使网站更加智能化、便捷。 5. 测试上线:完成以上步骤后,进行测试并上线。测试需要保证网站各页面及功能正常,包括页面加载速度、用户体验等。 制作简单购物网站需要掌握HTML、CSS、JavaScript等技术,并注重网站美观度、用户体验、易用性,可以适当借鉴其他网站的设计及文案,但也要注意版权问题。同时,购物网站关注的是用户需求,需注重与用户的交互和沟通,提供完善的购物体验。
评论 24
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值