1. 程式人生 > >Web前端模板(輪播圖排版)

Web前端模板(輪播圖排版)

在這裡插入圖片描述程式碼已經上傳到碼雲https://gitee.com/cuteSeven/webPageExample.git 這是頁面效果 這是html程式碼

在這裡插入程式碼片
```<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" type="text/css" href="css/cuteSeven.css" />
    <script src="js/jquery-1.4.4.min.js"></script>
    <script src="js/myfocus-2.0.1.min.js"></script>
    <title>enterprisePage</title>
</head>
<script type="text/javascript">
myFocus.set({
    id:'focus-box',
    pattern:'mF_fancy',
    time:2,
    trigger:'click',
    width:1200,
    height:310,
    txtheight:'default'//文字層的高度設定 default為預設高度 
});
</script>
<body>
<div id="main-wrapper">
    <!--top-->
    <div id="top" >
       <i id="logo"></i>
    <div>
        <i id="phone"></i>
        <span>My email</span>
        <span>
[email protected]
</span> </div> </div> <!--導航欄--> <div id="nav"> <nav> <a href="#">first page</a> <a href="#">second page</a> <a href="#">third page</a> <a href="#">four page</a> <a href="#">five page</a> </nav> <form id="search"> <input type="text" name="" id="search-input"> <button id="search-icon"></button> </form> </div> <!--焦點圖--> <div id="focus-box"> <div class="loading"><img src="images/loading.gif" alt="please wait"></div> <div class="pic"> <ul> <li><a href="#"><img src="images/ad.jpg"></a></li> <li><a href="#"><img src="images/ad2.jpg"></a></li> <li><a href="#"><img src="images/ad3.jpg"></a></li> <li><a href="#"><img src="images/ad4.jpg"></a></li> </ul> </div> </div> <!--content--> <div id="main-content"> <div id="news-center"> <div class="th"> <span>part1</span> <span>More&gt;&gt;</span> </div> <div class="news-ad"> <img src="images/news.jpg" alt=""> <p> <span>angular</span><br> <span>vue</span><br> <span>node</span><br> <span>learn more&gt;&gt;</span> </p> <br> </div> <div class="news-list"> <ul> <li><span>AngularJS 把應用程式資料繫結到HTML元素。</span></li> <li><span>Vue是通過簡單的 API 實現響應的資料繫結和組合的檢視元件。</span></li> <li><span>Node.js 是執行在服務端的 JavaScript,</span></li> </ul> </div> </div> <div id="course-center"> <div class="th"> <span>study</span> <span>More&gt;&gt;</span> </div> <div class="course-ad"> <img src="images/css.jpg" alt=""> <p> <span>css圓角進化論</span><br> CSS圓角的實現,經歷了三大發展階段:背 景圖片方式、CSS2.0+HTML標籤模擬、CSS3.0圓角屬性)。本案例詳細講解每一種的實現方式,並對實現的優缺點進行對比分析。 </p> </div> <div class="course-language"> <ul> <li>php</li> <li>node</li> <li>c#</li> <li>java</li> </ul> </div> </div> <div id="media-center"> <div class="th"> <span>iqiyi</span> <span>More&gt;&gt;</span> </div> <div class="center_div"> <div class="video"> <embed src="http://player.youku.com/player.php/sid/XNjkzMDE5MTUy/v.swf" allowfullscreen="true" quality="high" width="220" height="140" align="middle" allowscriptaccess="always" type="application/x-shockwave-flash"> </div> <div class="media-ad"><img src="images/angular.png" alt=""></div> </div> </div> </div> </div> <footer> <div> <ul> <li>javascript</li> <li>html</li> <li>css</li> <li>vue</li> </ul> <ul> <li>php</li> <li>c</li> <li>c++</li> <li>c#</li> </ul> <ul> <li>python</li> <li>sql</li> <li>mysql</li> <li>go</li> </ul> <ul> <li><img src="images/weixin.png" alt="">mywechat</li> <li><img width="120" src="images/author.jpg" alt=""></li> </ul> </div> </footer> </body> </html>

這是css程式碼

*{margin: 0;
padding: 0}

body{
    background: rgb(245,245,245);
}

#main-wrapper{
    width: 1200px;
    margin: 0 auto;
}
#main-wrapper #top{
    width: 100%;
    height: 80px;
    line-height: 80px;
    background-color: #fff;
}
#top #logo{
    width: 200px;
    height: 80px;
    background-image: url(../images/logo.jpg);
    float: left;
}
#top>div{
    float: right;
    margin-right: 25px;
    color :rgb(156,156,187);
    font-size: 12px;
}
#top>div #phone{
    display: inline-block;
    width: 28px;
    height: 28px;
    background-image: url(../images/tel.jpg);
}
#top>div>span:last-child{
    color: rgb(204,0,87);
    font-size: 23px;
}
#main-wrapper #nav{
    width: 100%;
    background: rgb(120, 111, 102);
    height: 40px;
    line-height: 40px;
    border-radius: 4px;
    display: flex;
    align-items: center
}
#nav nav{
    float: left;
}
nav>a{
    color: #fff;
    padding: 5px;
    margin-left: 35px;
    text-decoration: none;
}
nav>a:hover{
    font-size: 25px;
}

#nav #search{
    background: #fff;
    float: left;
    margin-left: 135px;
    height: 25px;
    line-height: 25px;
    padding: 2px 2px 2px 5px;
    border-radius: 2px;
}
#search #search-input{
    margin-top:0;
    width: 200px;
    outline: none;
    height: 25px;
    border: none;
    float: left; 
}
#search>#search-icon{
    float: left;
    outline: none;
    border: none;
    width: 25px;
    height: 21px;
    background-image: url(../images/search.jpg);
}
#focus-box{
    width: 1200px;
    height: 310px;
    margin-top: 15px;
    clear: both;
}
#main-wrapper #main-content{
    width: 1200px;
    background: #fff;
    margin-top: 15px;
    height: 250px;
}

#main-content>div{
    border:1px solid #c2c2c2;
}
#main-content #news-center{
    width: 380px;
    float: left;
    height: 250px;
}
#main-content #course-center{
    width: 400px;
    float: left;
    margin-left: 10px;
    height: 250px;
}
#main-content #media-center{

	width: 360px;
	float: right;
	margin-right:0;
	height: 250px;
}
#main-content .th{
    width: 100%;
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 14px;
    height: 20px;
    line-height: 20px;
    font-weight: 700;
    border-bottom: 2px solid #c2c2c2;
}
.th>span{
    padding: 0 20px;
}
.th>span:last-child{
    float: right;
}
.news-ad,.course-ad,.news-list,.video,.media-ad{
	padding: 5px;
}
.news-ad>p,.course-ad>p{
    display: inline-block;
    font-size: 12px;
}
.news-ad>p>span,.course-ad>p>span{
    display: inline-block  ;
    padding-left: 2px;
    height: 24px;
    line-height: 24px;
    font-weight: 700;
}
.news-ad>p>span:first-child,.news-ad>p>span:last-child,.course-ad>p>span:first-child{
	color: red;
}
.news-ad>p>span:last-child{
    font-weight: lighter;
}
.course-ad>p{
    width: 225px;
    font-weight: lighter;
}
.news-list>ul{
    list-style: none;
    font-size: 12px;
    color: rgb(108, 108, 108)
}
.news-list>ul>li{
	clear: right;
	border-bottom: 1px solid rgb(108,108,108);
	background-image: url(../images/list.jpg) no-repeat left center; 
}
.news-list>ul>li>span{
	display: inline-block;
	height: 25px;
	line-height: 25px;
}
.course-language{
    margin-top: 40px;
    clear: both
}
.course-language>ul{
	width: 380px;
	list-style: none;
	height: 25px;
	background-image: url(../images/product_type_bg.jpg);
}
.course-language>ul li{
	display: inline-block;
	float: left;
	height: 25px;
	line-height: 25px;
	padding: 5px;
	margin-left: 10px;
}



footer{
	width: 100%;
	background: rgb(232,232,232);
	margin:0;
	padding-top:20px;
}


footer>div{
	width: 1000px;
	margin:auto;
	column-count: 4;
	column-rule:2px solid rgb(153,153,153);

}
footer>div>ul{
	list-style: none;
}
footer>div>ul>li{
	width:250px; 
	height: 25px;
	line-height: 25px;
	padding: 5px;
	text-align: center;
	color:rgb(153,153,153);
}
footer>div>ul>li:first-child{
	font-weight: 500;
	color:#000;
}
.center_div{
    margin: 0 auto;
    text-align: center
}