温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

怎么用HTML实现化妆品网站

发布时间:2022-10-17 14:51:16 阅读:216 作者:iii 栏目:web开发
前端开发者测试专用服务器限时活动,0元免费领,库存有限,领完即止! 点击查看>>

本篇内容主要讲解“怎么用HTML实现化妆品网站”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“怎么用HTML实现化妆品网站”吧!

HTML结构代码

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link href="css/all.css" rel="stylesheet"  media="all" type="text/css" />
<link rel="stylesheet" href="./css/new.css">
<title>雅诗兰黛</title>
</head>
<script type="text/javascript">.onload = function(){
    function $(param){
      if(arguments[1] == true){
        return document.querySelectorAll(param);
      }else{
        return document.querySelector(param);
      }
    }
    var $box = $(".box1");
    var $box1 = $(".box-1 ul li",true);
    var $box2 = $(".box-2 ul");
    var $box3 = $(".box-3");
    var $length = $box1.length;
    
    var str = "";
    for(var i =0;i<$length;i++){
      if(i==0){
        str +="<li class='on'>"+(i+1)+"</li>";
      }else{
        str += "<li>"+(i+1)+"</li>";
      }
    }
    $box2.innerHTML = str;
    
    var current = 0;
    
    var timer;
    timer = setInterval(go,1000);
    function go(){
      for(var j =0;j<$length;j++){
        $box1[j].style.display = "none";
        $box2.children[j].className = "";
      }
      if($length == current){
        current = 0;
      }
      $box1[current].style.display = "block";
      $box2.children[current].className = "on";
      current++;
    }
    
    for(var k=0;k<$length;k++){
      $box1[k].onmouseover = function(){
        clearInterval(timer);
      }
      $box1[k].onmouseout = function(){
        timer = setInterval(go,1000);
      }
    }
    for(var p=0;p<$box3.children.length;p++){
      $box3.children[p].onmouseover = function(){
        clearInterval(timer);
      };
      $box3.children[p].onmouseout = function(){
        timer = setInterval(go,1000);
      }
    }
    
    for(var u =0;u<$length;u++){
      $box2.children[u].index  = u;
      $box2.children[u].onmouseover = function(){
        clearInterval(timer);
        for(var j=0;j<$length;j++){
          $box1[j].style.display = "none";
          $box2.children[j].className = "";
        }
        this.className = "on";
        $box1[this.index].style.display = "block";
        current = this.index +1;
      }
      $box2.children[u].onmouseout = function(){
        timer = setInterval(go,1000);
      }
    }
    
    $box3.children[0].onclick = function(){
      back();
    }
    $box3.children[1].onclick = function(){
      go();
    }
    function back(){
      for(var j =0;j<$length;j++){
        $box1[j].style.display = "none";
        $box2.children[j].className = "";
      }
      if(current == 0){
        current = $length;
      }
      $box1[current-1].style.display = "block";
      $box2.children[current-1].className = "on";
      current--;
    }
  }</script>
<body>
<header class="logo"> <img src="images/logo.jpg" width="100" /> </header>
<nav class="menu">
  <ul class="center">
    <li><a href="index.html">首页</a></li>
    <li><a href="product.html">所有商品</a></li>
    <li><a href="about.html">关于我们</a></li>
    <li><a href="contact.html">联系我们</a></li>
  </ul>
</nav>
<div class="box1 banner">
  <div class="box-1">
    <ul>
      <li>
        <img src="img/新建文件夹 (2)/口红.jpg" ></img>
      </li>
      <li>
        <img src="img/新建文件夹 (2)/小棕瓶.jpg"></img>
      </li>
      <li>
        <img src="img/新建文件夹 (2)/粉底液.jpg"></img>
      </li>
      <li>
        <img src="img/新建文件夹 (2)/精华.jpg" ></img>
      </li>
      <li>
        <img src="img/新建文件夹 (2)/面霜.jpg" ></img>
      </li>
    </ul>
  </div>
  <div class="box-2">
    <ul>
      
    </ul>
  </div>
  <div class="box-3">
    <span class="prev"> < </span>
    <span class="next"> > </span>
  </div>
</div>
<div class="content">
  <div class="box">
    <div class="bar">
      <h4>产品中心</h4>
    </div>
    <div class="list" style="clear:both">
      <ul>
        <li> <a href="proinfo.html"><img src="images/1.jpg" ></a>
          <p>红石榴养肤洁颜油 </p>
        </li>
        <li> <a href="proinfo.html"><img src="images/2.jpg" ></a>
          <p>鲜活亮采红石榴二合一洁面乳 </p>
        </li>
        <li> <a href="proinfo.html"><img src="images/3.jpg" ></a>
          <p>权杖唇霜 </p>
        </li>
        <li> <a href="proinfo.html"><img src="images/4.jpg" ></a>
          <p>胶原霜(乳霜款) </p>
        </li>
      </ul>
    </div>
    <div class="clear"></div>
  </div>
  <div class="bar">
    <h4>公司介绍</h4>
  </div>
  <div class="box">
    <div class="pad" align="center">
      <div>
        <p>雅诗兰黛公司创立于1946年,技术先进,不断创新,凭着其研发的各类精致优雅而又奢华的产品而享誉全球。<br>
          历经广泛的研究以及一贯严格的产品测试,她旗下的所有产品都秉承高水准的保证。</p>
        <p>雅诗兰黛产品在各大高档购物中心以及专卖店有售点击这里 <br>
          查找距离您最近的雅诗兰黛专柜。
</p>
      </div>
    </div>
    <div class="clear"></div>
  </div>
</div>
<footer class="end">
  <p>网页底部</p>
</footer>
</body>
</html>

CSS样式代码

@charset "utf-8";
/* CSS Document */
ul,li,h2,h3,h4,ppadding:0margin:0list-style:none}
imgmax-width:100%}
atext-decoration: none;}
bodywidth:1200pxbackground:#eeemargin:0px auto; line-height:21px}
.clearclear:both}
.menu lilist-style:none}

.logobackground:#002563}

.menu { background:#fffwidth:100%text-align:center; float:left;  }
.menu li acolor:#000}
.menu li { float:leftmargin:2pxpadding:15px 30px ; width:134px}

.rightfloat:rightwidth:660pxpadding:20px}
.leftfloat:leftwidth:630pxpadding:10px}
.content { padding-bottom:20px;font-size:16pxline-height:26pxdisplay:inline-block ; color:#111width:100%}
.boxmargin-top:20pxpadding-bottom:10px;   }
.endclear:both; background:#002563color:#fffpadding:10px 0text-align:center;}
.produce img{  margin:0 20px 20px 0}
.produce { line-height:30px}
.padpadding:20pxline-height:40pxdisplay:block}
.pad acolor#000;}
.pad a:hovercolor#E1353A;}
.pics pmargin:1pxtext-align:center}

.imglistwidth:100%margin:0 auto}
.imglist lifloat:leftwidth:46%margin:2% ;  text-align:center}
.listmargin:10px}
.list litext-align:center;  width:280px;font-size:12pxmargin:40px 7pxfloat:left; }
.list li pfont-size18pxcolor#000;}

.list li imgpadding:2pxborder:#ccc solid 1px;  width90%;}

.titletext-align:center; color:#F00padding:10px}
.flfloat:left}
.js  divwidth:100%clear:both; margin-bottom:20pxfloat:left}

.js div imgfloat:leftmargin-right:20px.msg>divpadding:10px 0}
#submit2margin-top:30pxpadding:10pxbackground:#993366color:#fffborder:none; width:100%}
.msgwidth:400pxmargin:0 auto}
.msg div spandisplay:block;}
.msg div inputbackground:#a07ea6padding:10px 0width:100%border:none;}
.barmargin:0px ;background:#002563clear:both; font-weight:bold; padding:5px 15pxcolor:#fff}
.bar h4color:#ffffont-size:20px;}
.bar afloat:rightcolor:#fff}

.lefloat:leftwidth:49%;}
.rifloat:rightwidth:49%;}

.txt {
  line-height26px;
  font-size14px;
  color#333;
  width:660pxfloat:right;
  margin-top:20px
}
.txt h3font-size:36pxline-height:50px ; font-weight:normal }
form {
  width660px;
  float: right;  margin-top:20px;
}
form p {
  margin10px 0;
  font-size16px;
  color#333;
}
form .phone {
  width100%;
  height36px;
  padding0 10px;
  box-sizing: border-box;
  border1px solid #ccc;
}
form textarea {
  width100%;
  height100px;
}
form .but {
  background:#002563;
  border: none;
  color#fff;
  margin20px 0;
  display: block;
  width200px;
  height36px;
}
.lx_pic {
  float: left;
  width460px;

  margin-top:20px;
}
.lx_pic img {
  
  width100%;
}
.newslist liborder-bottom:#ccc dashed 1pxpadding:10px}

到此,相信大家对“怎么用HTML实现化妆品网站”有了更深的了解,不妨来实际操作一番吧!这里是亿速云网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!

亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

原文链接:https://blog.51cto.com/u_15398742/5729873

AI

开发者交流群×