手机网站 - 专业服务,优质产品,值得信赖
<!DOCTYPE html>
<html>
<head>
<title>手机网站 - 专业服务,优质产品,值得信赖</title>
<style type="text/css">
body{
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
}
nav{
background-color: #333;
color: #fff;
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px;
}
nav ul{
display: flex;
list-style: none;
margin: 0;
padding: 0;
}
nav ul li{
margin-right: 20px;
font-size: 16px;
font-weight: bold;
}
nav ul li a{
color: #fff;
text-decoration: none;
}
.slider{
position: relative;
height: 400px;
}
.slide{
position: absolute;
top: 0;
left: 0;
height: 400px;
width: 100%;
opacity: 0;
transition: opacity 1s ease-in-out;
}
.slide.active{
opacity: 1;
}
.slide img{
height: 400px;
width: 100%;
}
.slider-nav{
position: absolute;
bottom: 10px;
left: 50%;
transform: translateX(-50%);
display: flex;
justify-content: center;
align-items: center;
z-index: 1;
}
.slider-nav button{
background-color: #333;
color: #fff;
border: none;
padding: 10px;
cursor: pointer;
margin-right: 10px;
}
.slider-nav button.active{
background-color: #fff;
color: #333;
}
.image-list{
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
padding: 20px;
}
.image-list li{
flex-basis: calc(50% - 20px);
margin-bottom: 20px;
}
.image-list img{
width: 100%;
}
.image-list h3{
margin-top: 10px;
font-size: 16px;
font-weight: bold;
}
.services{
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px;
}
.services li{
flex-basis: calc(33.33% - 20px);
}
.services img{
width: 100%;
margin-bottom: 10px;
}
.services h3{
font-size: 16px;
font-weight: bold;
margin-top: 10px;
}
.news{
padding: 20px;
}
.news li{
margin-bottom: 10px;
font-size: 16px;
font-weight: bold;
display: flex;
justify-content: space-between;
align-items: center;
}
.news li span{
color: #999;
font-size: 14px;
font-weight: normal;
}
.company{
padding: 20px;
}
.company img{
width: 100%;
margin-bottom: 20px;
}
.company h2{
font-size: 24px;
font-weight: bold;
margin-bottom: 10px;
}
.team{
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
padding: 20px;
}
.team li{
flex-basis: calc(50% - 20px);
margin-bottom: 20px;
}
.team img{
width: 100%;
margin-bottom: 10px;
}
.team h3{
font-size: 16px;
font-weight: bold;
margin-top: 10px;
}
.contact{
padding: 20px;
}
.contact h2{
font-size: 24px;
font-weight: bold;
margin-bottom: 10px;
}
.contact p{
font-size: 16px;
margin-bottom: 10px;
}
</style>
</head>
<body>
<nav>
<h1>手机网站</h1>
<ul>
<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>
</nav>
<div class='slider'>
<div class='slide active'>
<img src='https://via.placeholder.com/800x400.png?text=Slide+1' alt='Slide 1'>
</div>
<div class='slide'>
<img src='https://via.placeholder.com/800x400.png?text=Slide+2' alt='Slide 2'>
</div>
<div class='slide'>
<img src='https://via.placeholder.com/800x400.png?text=Slide+3' alt='Slide 3'>
</div>
<div class='slider-nav'>
<button class='active'></button>
<button></button>
<button></button>
</div>
</div>
<ul class='image-list'>
<li>
<img src='https://via.placeholder.com/400x300.png?text=Image+1' alt='Image 1'>
<h3>Image 1</h3>
</li>
<li>
<img src='https://via.placeholder.com/400x300.png?text=Image+2' alt='Image 2'>
<h3>Image 2</h3>
</li>
<li>
<img src='https://via.placeholder.com/400x300.png?text=Image+3' alt='Image 3'>
<h3>Image 3</h3>
</li>
<li>
<img src='https://via.placeholder.com/400x300.png?text=Image+4' alt='Image 4'>
<h3>Image 4</h3>
</li>
<li>
<img src='https://via.placeholder.com/400x300.png?text=Image+5' alt='Image 5'>
<h3>Image 5</h3>
</li>
<li>
<img src='https://via.placeholder.com/400x300.png?text=Image+6' alt='Image 6'>
<h3>Image 6</h3>
</li>
</ul>
<ul class='services'>
<li>
<img src='https://via.placeholder.com/100x100.png?text=Service+1' alt='Service 1'>
<h3>Service 1</h3>
</li>
<li>
<img src='https://via.placeholder.com/100x100.png?text=Service+2' alt='Service 2'>
<h3>Service 2</h3>
</li>
<li>
<img src='https://via.placeholder.com/100x100.png?text=Service+3' alt='Service 3'>
<h3>Service 3</h3>
</li>
</ul>
<ul class='news'>
<li>
<a href='#'>News 1</a>
<span>01/01/2021</span>
</li>
<li>
<a href='#'>News 2</a>
<span>02/01/2021</span>
</li>
<li>
<a href='#'>News 3</a>
<span>03/01/2021</span>
</li>
<li>
<a href='#'>News 4</a>
<span>04/01/2021</span>
</li>
<li>
<a href='#'>News 5</a>
<span>05/01/2021</span>
</li>
<li>
<a href='#'>News 6</a>
<span>06/01/2021</span>
</li>
<li>
<a href='#'>News 7</a>
<span>07/01/2021</span>
</li>
<li>
<a href='#'>News 8</a>
<span>08/01/2021</span>
</li>
<li>
<a href='#'>News 9</a>
<span>09/01/2021</span>
</li>
<li>
<a href='#'>News 10</a>
<span>10/01/2021</span>
</li>
</ul>
<div class='company'>
<img src='https://via.placeholder.com/800x400.png?text=Company+Image' alt='Company Image'>
<h2>公司简介</h2>
<p>这里是公司简介的内容。</p>
</div>
<ul class='team'>
<li>
<img src='https://via.placeholder.com/400x300.png?text=Team+1' alt='Team 1'>
<h3>Team 1</h3>
</li>
<li>
<img src='https://via.placeholder.com/400x300.png?text=Team+2' alt='Team 2'>
<h3>Team 2</h3>
</li>
<li>
<img src='https://via.placeholder.com/400x300.png?text=Team+3' alt='Team 3'>
<h3>Team 3</h3>
</li>
<li>
<img src='https://via.placeholder.com/400x300.png?text=Team+4' alt='Team 4'>
<h3>Team 4</h3>
</li>
</ul>
<div class='contact'>
<h2>联系方式</h2>
<p>地址:XXX市XXX区XXX路XXX号</p>
<p>电话:XXX-XXXXXXX</p>
<p>邮箱:info@example.com</p>
</div>
<script type='text/javascript'>
var slides = document.querySelectorAll('.slide');
var buttons = document.querySelectorAll('.slider-nav button');
<pre><code> var currentSlide = 0;
function nextSlide(){
slides[currentSlide].classList.remove('active');
buttons[currentSlide].classList.remove('active');
currentSlide = (currentSlide + 1) % slides.length;
slides[currentSlide].classList.add('active');
buttons[currentSlide].classList.add('active');
}
buttons.forEach(function(button, index){
button.addEventListener('click', function(){
slides[currentSlide].classList.remove('active');
buttons[currentSlide].classList.remove('active');
currentSlide = index;
slides[currentSlide].classList.add('active');
buttons[currentSlide].classList.add('active');
});
});
setInterval(nextSlide, 5000);
</script>
</code></pre>
</body>
</html>
原文地址: https://www.cveoy.top/t/topic/mTVQ 著作权归作者所有。请勿转载和采集!