马上注册,自学更多教程,下载更多资源。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
纯HTML代码编写的WAP站首页模板,适用于各种WAP站点
[HTML] 纯文本查看 复制代码 <!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>手机WAP站</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
line-height: 1.5;
background: #f5f5f5;
}
.header {
background: #fff;
padding: 10px;
text-align: center;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
/* 幻灯片样式 */
.slider {
position: relative;
overflow: hidden;
height: 200px;
}
.slider-wrapper {
display: flex;
transition: transform 0.3s ease;
}
.slide {
flex: 0 0 100%;
height: 200px;
}
.slide img {
width: 100%;
height: 100%;
object-fit: cover;
}
/* 头条样式 */
.headlines {
background: #fff;
padding: 10px;
margin: 10px 0;
}
.headline-title {
color: #f00;
font-weight: bold;
border-left: 3px solid #f00;
padding-left: 10px;
margin-bottom: 10px;
}
.headline-content {
padding: 5px 0;
border-bottom: 1px solid #eee;
}
/* 选项卡样式 */
.tabs {
background: #fff;
margin-top: 10px;
}
.tab-nav {
display: flex;
border-bottom: 1px solid #eee;
}
.tab-nav button {
flex: 1;
padding: 10px;
border: none;
background: none;
font-size: 14px;
}
.tab-nav button.active {
color: #007bff;
border-bottom: 2px solid #007bff;
}
.tab-content {
display: none;
padding: 10px;
}
.tab-content.active {
display: block;
}
.news-item {
padding: 10px 0;
border-bottom: 1px solid #eee;
display: flex;
align-items: center;
gap: 10px;
}
.news-item:last-child {
border-bottom: none;
}
.news-item-content {
flex: 1;
}
.news-item-title {
font-size: 15px;
margin-bottom: 4px;
}
.news-item-desc {
font-size: 12px;
color: #666;
}
.news-item-image {
width: 80px;
height: 60px;
border-radius: 4px;
object-fit: cover;
}
</style>
</head>
<body>
<header class="header">
<h1>WAP站点</h1>
</header>
<!-- 幻灯片 -->
<div class="slider">
<div class="slider-wrapper">
<div class="slide">
<img src="https://via.placeholder.com/400x200/007bff/ffffff?text=Slide+1" alt="幻灯片1">
</div>
<div class="slide">
<img src="https://via.placeholder.com/400x200/28a745/ffffff?text=Slide+2" alt="幻灯片2">
</div>
<div class="slide">
<img src="https://via.placeholder.com/400x200/dc3545/ffffff?text=Slide+3" alt="幻灯片3">
</div>
</div>
</div>
<!-- 头条 -->
<div class="headlines">
<div class="headline-title">头条新闻</div>
<div class="headline-content">重要新闻:2024年全球科技发展趋势分析</div>
<div class="headline-content">最新动态:人工智能在医疗领域取得重大突破</div>
</div>
<!-- 选项卡 -->
<div class="tabs">
<div class="tab-nav">
<button class="active">科技</button>
<button>财经</button>
<button>体育</button>
</div>
<div class="tab-content active">
<div class="news-item">
<div class="news-item-content">
<div class="news-item-title">最新5G技术发展报告</div>
<div class="news-item-desc">全球5G技术应用与发展最新动态分析</div>
</div>
<img class="news-item-image" src="https://via.placeholder.com/80x60/007bff/ffffff?text=5G" alt="5G技术">
</div>
<div class="news-item">
<div class="news-item-content">
<div class="news-item-title">量子计算机研究新进展</div>
<div class="news-item-desc">科学家在量子计算领域取得重大突破</div>
</div>
<img class="news-item-image" src="https://via.placeholder.com/80x60/28a745/ffffff?text=Quantum" alt="量子计算">
</div>
<div class="news-item">
<div class="news-item-content">
<div class="news-item-title">新一代智能手机发布</div>
<div class="news-item-desc">各大厂商发布最新旗舰智能手机</div>
</div>
<img class="news-item-image" src="https://via.placeholder.com/80x60/dc3545/ffffff?text=Phone" alt="智能手机">
</div>
</div>
<div class="tab-content">
<div class="news-item">
<div class="news-item-content">
<div class="news-item-title">全球经济形势分析</div>
<div class="news-item-desc">2024年全球经济发展趋势预测</div>
</div>
<img class="news-item-image" src="https://via.placeholder.com/80x60/ffc107/ffffff?text=Economy" alt="经济分析">
</div>
<div class="news-item">
<div class="news-item-content">
<div class="news-item-title">股市最新动态</div>
<div class="news-item-desc">全球主要股市表现及投资机会分析</div>
</div>
<img class="news-item-image" src="https://via.placeholder.com/80x60/17a2b8/ffffff?text=Stock" alt="股市动态">
</div>
<div class="news-item">
<div class="news-item-content">
<div class="news-item-title">数字货币发展趋势</div>
<div class="news-item-desc">数字货币市场最新发展动态报道</div>
</div>
<img class="news-item-image" src="https://via.placeholder.com/80x60/6c757d/ffffff?text=Crypto" alt="数字货币">
</div>
</div>
<div class="tab-content">
<div class="news-item">
<div class="news-item-content">
<div class="news-item-title">世界杯最新赛况</div>
<div class="news-item-desc">世界杯赛事精彩回顾与分析</div>
</div>
<img class="news-item-image" src="https://via.placeholder.com/80x60/e83e8c/ffffff?text=WorldCup" alt="世界杯">
</div>
<div class="news-item">
<div class="news-item-content">
<div class="news-item-title">NBA赛事报道</div>
<div class="news-item-desc">NBA联赛最新战报与球星动态</div>
</div>
<img class="news-item-image" src="https://via.placeholder.com/80x60/fd7e14/ffffff?text=NBA" alt="NBA">
</div>
<div class="news-item">
<div class="news-item-content">
<div class="news-item-title">奥运会筹备进展</div>
<div class="news-item-desc">奥运会筹备工作最新进展报道</div>
</div>
<img class="news-item-image" src="https://via.placeholder.com/80x60/20c997/ffffff?text=Olympic" alt="奥运会">
</div>
</div>
</div>
<script>
// 幻灯片功能
let currentSlide = 0;
const sliderWrapper = document.querySelector('.slider-wrapper');
const slides = document.querySelectorAll('.slide');
function nextSlide() {
currentSlide = (currentSlide + 1) % slides.length;
updateSlider();
}
function updateSlider() {
sliderWrapper.style.transform = `translateX(-${currentSlide * 100}%)`;
}
setInterval(nextSlide, 3000);
// 选项卡功能
function showTab(index) {
const tabs = document.querySelectorAll('.tab-content');
const buttons = document.querySelectorAll('.tab-nav button');
tabs.forEach(tab => tab.classList.remove('active'));
buttons.forEach(button => button.classList.remove('active'));
tabs[index].classList.add('active');
buttons[index].classList.add('active');
}
</script>
</body>
</html>
上一篇:点击广告后才会显示出内容的代码 |