h5响应式企业网站源码怎么找?免费开源模板下载

立即咨询

<!-- 关于我们 -->
<section id="about" class="section">
    <div class="container">
        <h2 class="section-title">关于我们</h2>
        <div class="about-content">
            <div class="about-text">
                <p>成立于2010年,我们是一家专注于技术创新的企业服务公司,凭借多年的行业经验,我们帮助超过500家企业实现了数字化转型。</p>
                <ul class="features">
                    <li><i class="fas fa-check-circle"></i> 专业团队</li>
                    <li><i class="fas fa-check-circle"></i> 快速响应</li>
                    <li><i class="fas fa-check-circle"></i> 定制服务</li>
                </ul>
            </div>
            <div class="about-image">
                <!-- 替换为实际图片 -->
                <img src="https://via.placeholder.com/600x400" alt="关于我们">
            </div>
        </div>
    </div>
</section>
<!-- 服务项目 -->
<section id="services" class="section bg-light">
    <div class="container">
        <h2 class="section-title">我们的服务</h2>
        <div class="services-grid">
            <div class="service-card">
                <i class="fas fa-laptop-code"></i>
                <h3>网站开发</h3>
                <p>响应式企业官网、电商平台、Web应用开发。</p>
            </div>
            <div class="service-card">
                <i class="fas fa-mobile-alt"></i>
                <h3>移动应用</h3>
                <p>iOS/Android原生开发及跨平台解决方案。</p>
            </div>
            <div class="service-card">
                <i class="fas fa-chart-line"></i>
                <h3>数字营销</h3>
                <p>SEO优化、社交媒体营销、数据分析服务。</p>
            </div>
        </div>
    </div>
</section>
<!-- 联系我们 -->
<section id="contact" class="section">
    <div class="container">
        <h2 class="section-title">联系我们</h2>
        <div class="contact-wrapper">
            <div class="contact-info">
                <p><i class="fas fa-map-marker-alt"></i> 地址:北京市朝阳区科技大厦A座</p>
                <p><i class="fas fa-phone"></i> 电话:400-123-4567</p>
                <p><i class="fas fa-envelope"></i> 邮箱:contact@company.com</p>
            </div>
            <form class="contact-form">
                &l

h5响应式企业网站源码怎么找?免费开源模板下载

免费搭建企业网站 | 零成本个人网站制作视频教程2021 | 用免费的主机&amp;域名和WP主题创建网站 | 网站免费建设详细操作视频教程
加载中
免费搭建企业网站 | 零成本个人网站制作视频教程2021 | 用免费的主机&amp;域名和WP主题创建网站 | 网站免费建设详细操作视频教程
t;input type="text" placeholder="您的姓名" required> <input type="email" placeholder="您的邮箱" required> <textarea placeholder="留言内容" rows="5" required></textarea> <button type="submit" class="btn btn-primary">发送消息</button> </form> </div> </div> </section> <!-- 页脚 --> <footer class="footer"> <div class="container"> <p>&copy; 2026 企业名称. 保留所有权利.</p> <div class="social-links"> <a href="#"><i class="fab fa-weixin"></i></a> <a href="#"><i class="fab fa-weibo"></i></a> <a href="#"><i class="fab fa-linkedin"></i></a> </div> </div> </footer> <script src="js/main.js"></script>



“`


css/style.css

/ 全局重置 /
 {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}
a {
    text-decoration: none;
    color: inherit;
}
ul {
    list-style: none;
}
/ 导航栏 /
.header {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}
.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}
.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #0056b3;
}
.nav-list {
    display: flex;
    gap: 20px;
}
.nav-list a {
    font-weight: 500;
    transition: color 0.3s;
}
.nav-list a:hover {
    color: #0056b3;
}
.menu-toggle {
    display: none;
    cursor: pointer;
}
.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: #333;
    transition: all 0.3s ease;
}
/ 主视觉区域 /
.hero {
    background: linear-gradient(135deg, #0056b3, #003d80);
    color: #fff;
    height: 100vh;
    display: flex;
    align-items: center;
    text-align: center;
    padding-top: 70px; / 避免被固定导航栏遮挡 /
}
.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}
.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: bold;
    transition: background 0.3s;
}
.btn-primary {
    background: #fff;
    color: #0056b3;
}
.btn-primary:hover {
    background: #f0f0f0;
}
/ 通用区块样式 /
.section {
    padding: 80px 0;
}
.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 50px;

h5响应式企业网站源码怎么找?免费开源模板下载

position: relative; } .section-title::after { content: ''; display: block; width: 60px; height: 3px; background: #0056b3; margin: 10px auto 0; } .bg-light { background: #f9f9f9; } / 关于我们 / .about-content { display: flex; gap: 40px; align-items: center; } .about-text, .about-image { flex: 1; } .about-image img { width: 100%; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); } .features { margin-top: 20px; } .features li { margin-bottom: 10px; font-size: 1.1rem; } .features i { color: #0056b3; margin-right: 10px; } / 服务网格 / .services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; } .service-card { background: #fff; padding: 30px; border-radius: 8px; text-align: center; box-shadow: 0 4px 6px rgba(0,0,0,0.05); transition: transform 0.3s; } .service-card:hover { transform: translateY(-5px); } .service-card i { font-size: 2.5rem; color: #0056b3; margin-bottom: 20px; } .service-card h3 { margin-bottom: 15px; } / 联系我们 / .contact-wrapper { display: flex; gap: 40px; } .contact-info, .contact-form { flex: 1; } .contact-info p { margin-bottom: 15px; font-size: 1.1rem; } .contact-info i { color: #0056b3; margin-right: 10px; width: 20px; } .contact-form input, .contact-form textarea { width: 100%; padding: 12px; margin-bottom: 15px; border: 1px solid #ddd; border-radius: 5px; font-family: inherit; } .contact-form button { background: #0056b3; color: #fff; border: none; cursor: pointer; } .contact-form button:hover { background: #004494; } / 页脚 / .footer { background: #333; color: #fff; padding: 40px 0; text-align: center; } .social-links { margin-top: 20px; } .social-links a { color: #fff; font-size: 1.5rem; margin: 0 10px; transition: color 0.3s; } .social-links a:hover { color: #0056b3; } / 响应式设计 / @media (max-width: 768px) { .menu-toggle { display: block; } .menu-toggle.active .bar:nth-child(1) { transform: rotate(-45deg) translate(-5px, 6px); } .menu-toggle.active .bar:nth-child(2) { opacity: 0; } .menu-toggle.active .bar:nth-child(3) { transform: rotate(45deg) translate(-5px, -6px); } .nav-list { position: fixed; left: -100%; top: 70px; flex-direction: column; background: #fff; width: 100%; text-align: center; transition: 0.3s; box-shadow: 0 10px 10px rgba(0,0,0,0.1); padding: 20px 0; } .nav-list.active { left: 0; } .nav-list li { margin: 15px 0; } .hero h1 { font-size: 2rem; } .about-content, .contact-wrapper { flex-direction: column; } .about-image { order: -1; / 图片在文字上方 / } }

h5响应式企业网站源码怎么找?免费开源模板下载


js/main.js

document.addEventListener('DOMContentLoaded', function() {
    const mobileMenu = document.getElementById('mobile-menu');
    const navList = document.querySelector('.nav-list');
    // 切换移动端菜单
    mobileMenu.addEventListener('click', function() {
        mobileMenu.classList.toggle('active');
        navList.classList.toggle('active');
    });
    // 点击导航链接后关闭菜单(移动端体验优化)
    document.querySelectorAll('.nav-list a').forEach(link => {
        link.addEventListener('click', () => {
            mobileMenu.classList.remove('active');
            navList.classList.remove('active');
        });
    });
    // 平滑滚动(兼容旧浏览器)
    document.querySelectorAll('a[href^="#"]').forEach(anchor => {
        anchor.addEventListener('click', function (e) {
            e.preventDefault();
            const target = document.querySelector(this.getAttribute('href'));
            if (target) {
                target.scrollIntoView({
                    behavior: 'smooth'
                });
            }
        });
    });
});

🚀 如何部署与使用

  1. 创建文件夹:在本地创建一个项目文件夹,按上述结构创建 index.htmlcss/style.cssjs/main.js
    • index.html 中的“企业名称”、“LOGO”等占位符替换为你的实际内容。
    • 将图片路径替换为你自己的图片(建议放在 images/ 文件夹中)。
  2. 测试响应式
    • 在浏览器中打开 index.html
    • 使用 Chrome 开发者工具(F12)切换不同设备视图(如 iPhone、iPad)测试布局。
  3. 部署上线

    可将文件上传至 GitHub Pages、Vercel、Netlify 或传统服务器(Nginx/Apache)。


💡 进阶建议

  • SEO 优化:确保 <meta name="description"><title> 包含关键词。
  • 性能优化:压缩图片(使用 WebP 格式),启用 Gzip 压缩。
  • 安全性:如果添加表单,建议使用后端语言(如 PHP、Node.js)或第三方服务(如 Formspree)处理提交,避免前端直接暴露邮箱。
  • 框架替代:如果需要更快速开发,可考虑使用 Bootstrap 或 Tailwind CSS 等框架。

如需特定功能(如多语言切换、后台管理系统对接),可进一步说明需求。

首发原创文章,作者:世雄 - 原生数据库架构专家,如若转载,请注明出处:https://idctop.com/article/477003.html

(0)
服务器配置后台怎么操作?服务器配置后台详细教程
上一篇 2026年7月9日 23:52
GEO优化到底该由市场部还是技术部负责?2026年GEO优化怎么做
下一篇 2026年7月9日 23:54

相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注