博主信息
博文 10
粉丝 0
评论 0
访问量 6805
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
企业站点联系我们页面,js基本语法 2019年7月9日 PHP学习第七课
Johnson的博客
原创
999人浏览过

企业站点“联系我们”页面代码如下:

<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="UTF-8">
   <title>联系我们</title>
   <style>
.header {
           background-color: black;
}
       .header .content {
           width: 1000px;
height: 60px;
background-color: black;
margin: 0 auto;
}
       .header .content .nav {
           margin: 0;
}
       .header .content .nav .item {
           list-style-type: none;
}
       .header .content .nav .item a {
           float: left;
min-width: 100px;
min-height: 60px;
line-height: 60px;
color: white;

text-decoration: none;
text-align: center;
}
       .header .content .nav .item a:hover {
           background-color: red;
font-size: 110%;
}
       /*中间内容*/
.container {
           width: 1000px;
margin: 5px auto;
overflow: hidden;
}
       .wrap {
           width: inherit;
min-height: 800px;
}
       .left {
           width: 280px;
min-height: 800px;
}
       .wrap, .left {
           float: left;
}
       .left {
           margin-left: -100%;
}
       .main {
           padding-left: 280px;
box-sizing: content-box;
}
       .main h3 {
           margin: 10px auto;
text-align: center;
border-bottom: 1px solid;
}
       .address ul li {
           list-style-type: none;
}
       .map {
              margin: 0;
padding: 20px;
}
       .map img {
           width: 580px;
height: 400px;

}
       .left h3 {
           margin: 10px auto;
text-align: center;
border-bottom: 1px solid;
}

       .left ul {
           margin: 0;
padding: 0;
list-style: none;
}

       .left li a {
           display: inline-block;
width: 100%;
height: 50px;
background-color: black;
color: white;
text-decoration-line: none;
line-height: 50px;
text-align: center;
}

       .left li a:hover {
           background-color: red;
font-size: 1.1em;
}
       .footer .content {
           width: 1000px;
height: 60px;
background-color: #444;
margin: 0 auto;
}
       .footer .content p {
           text-align: center;
line-height: 60px;
}
       .footer .content  a {
           text-decoration: none;
color: lightgrey;
}
       .footer .content  a:hover {
           color: white;
}
   </style>
</head>
<body>
<!-- 头部 -->
<div class="header">
   <div class="content">
       <ul class="nav">
           <li class="item"><a href="index.html">首页</a></li>
           <li class="item"><a href="news.html">公司新闻</a></li>
           <li class="item"><a href="products.html">最新产品</a></li>
           <li class="item"><a href="about.html">关于我们</a></li>
           <li class="item"><a href="contact.html">联系我们</a></li>
       </ul>
   </div>
</div>
<div class="container">
   <div class="banner">
       <img src="static/images/banner.jpg" alt="">
   </div>

   <div class="wrap">
       <div class="main">
           <div class="address">
               <h3>联系我们</h3>
               <ul>
                   <li>公司地址:中国杭州市余杭区文一西路969号</li>
                   <li>联系人:马云</li>
                   <li>***:023-01234567</li>
               </ul>
           </div>
           <div class="map">
               <img src="static/images/address.jpg" alt="">
           </div>
       </div>
   </div>
   <div class="left">
       <h3>栏目</h3>
       <div class="category">
           <ul>
               <li><a href="">公司新闻</a></li>
               <li><a href="">最新产品</a></li>
               <li><a href="">关于我们</a></li>
               <li><a href="">联系我们</a></li>
           </ul>
       </div>

   </div>


</div>
<div class="footer">
   <div class="content">
       <p>
           <a href="">&copy; PHP中文网版权所有</a> &nbsp;|&nbsp;
<a href="">0551-88889999</a> &nbsp;|&nbsp;
<a href="">皖ICP2016098801-1</a>
       </p>

   </div>
</div>
</body>
</html>


js的基本语法

if 判断 语句   代码如下:

var pay = 1000;
var say = '';

if (pay >= 3000 && pay < 6000){
   say = '还不错哦';
} else if(pay >= 6000){
   say = '有钱人哦';
} else{
   say = '给国家拖后腿了';
}
console.log(say);

三元判断结构:

say = ( pay >= 3000 )? '还可以哦':'给国家拖后腿了';
console.log(say);

switch判断语句:

switch (true) {
   case pay >=3000 && pay < 6000: say = '还可以';
   break;
   case pay >6000 && pay < 10000: say = '有钱人哦';
   break;
   case pay > 10000 : say = '富二代吧';
   break;
   default:
       say = '不好意思给国家拖后腿了';
}
console.log(say);

for循环语句:

var sum = 0 ;
for (var i = 0; i<10 ; i++){
   sum = sum + i ;
}
console.log(sum);

while循环语句

var sum = 0 ;

var i = 0 ;  //入口判断

while (i < 10){
   sum = sum + i ;
   i++;
}
console.log(sum);



批改状态:合格

老师批语:联系我们, 关于我们, 其实都是单页面, 布局方式是一样的,这种布局也适合用来创建专题页, JS的基础知识, 还可以再想些案例的
本博文版权归博主所有,转载请注明地址!如有侵权、违法,请联系admin@php.cn举报处理!
全部评论 文明上网理性发言,请遵守新闻评论服务协议
0条评论
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号

  • 登录PHP中文网,和优秀的人一起学习!
    全站2000+教程免费学