To create a modern and visually appealing HTML page with various CSS, jQuery, and 3D effects, you can follow these steps. I'll provide a basic structure with different elements, including a navigation bar in the top-right corner, 3D effects, and styling.
HTML Structure
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>现代化网页设计</title>
<link rel="stylesheet" href="styles.css">
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
</head>
<body>
<header>
<nav id="navbar">
<ul>
<li><a href="#home">首页</a></li>
<li><a href="#about">关于我们</a></li>
<li><a href="#services">服务</a></li>
<li><a href="#contact">联系我们</a></li>
</ul>
</nav>
<div class="hero-section">
<h1>欢迎来到现代化网页</h1>
<p>让您的浏览体验焕然一新</p>
</div>
</header>
<section id="home">
<h2>首页</h2>
<p>这是一个使用了3D效果的现代化网页。</p>
</section>
<section id="about">
<h2>关于我们</h2>
<p>我们致力于提供最好的用户体验。</p>
</section>
<section id="services">
<h2>服务</h2>
<div class="service-box">服务一</div>
<div class="service-box">服务二</div>
<div class="service-box">服务三</div>
</section>
<section id="contact">
<h2>联系我们</h2>
<form>
<input type="text" placeholder="姓名" required>
<input type="email" placeholder="邮箱" required>
<textarea placeholder="信息" required></textarea>
<button type="submit">发送</button>
</form>
</section>
<footer>
<p>© 2024 现代化网页设计. 版权所有.</p>
</footer>
<script src="scripts.js"></script>
</body>
</html>
CSS (styles.css)
/* Reset */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
/* Body and Background */
body {
font-family: 'Arial', sans-serif;
background-color: #f0f0f0;
background-image: linear-gradient(to right, #ff7e5f, #feb47b);
background-size: cover;
background-attachment: fixed;
color: #333;
line-height: 1.6;
}
/* Header and Navigation */
header {
position: relative;
height: 100vh;
background-color: rgba(0, 0, 0, 0.5);
color: white;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
nav#navbar {
position: absolute;
top: 20px;
right: 20px;
}
nav ul {
list-style: none;
}
nav ul li {
display: inline-block;
margin-left: 15px;
}
nav ul li a {
text-decoration: none;
color: white;
font-size: 18px;
font-weight: bold;
transition: color 0.3s ease;
}
nav ul li a:hover {
color: #ff7e5f;
}
.hero-section h1 {
font-size: 48px;
text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
animation: fadeIn 3s ease;
}
.hero-section p {
font-size: 24px;
margin-top: 10px;
animation: fadeInUp 2s ease;
}
/* Sections */
section {
padding: 60px 20px;
background-color: white;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
margin: 40px 0;
}
section h2 {
font-size: 36px;
margin-bottom: 20px;
color: #ff7e5f;
}
/* Service Boxes */
.service-box {
background-color: #feb47b;
color: white;
padding: 20px;
margin: 20px;
border-radius: 10px;
text-align: center;
transform: rotateY(0deg);
transition: transform 0.5s;
}
.service-box:hover {
transform: rotateY(360deg);
}
/* Form */
form {
display: flex;
flex-direction: column;
align-items: center;
}
form input, form textarea {
width: 80%;
margin-bottom: 20px;
padding: 10px;
border: 2px solid #ff7e5f;
border-radius: 5px;
}
form button {
padding: 10px 20px;
background-color: #ff7e5f;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s ease;
}
form button:hover {
background-color: #feb47b;
}
/* Footer */
footer {
background-color: #333;
color: white;
text-align: center;
padding: 10px;
}
/* Animations */
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes fadeInUp {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
JavaScript (scripts.js)
$(document).ready(function() {
// Scroll effect for navigation
$('nav ul li a').on('click', function(event) {
if (this.hash !== "") {
event.preventDefault();
var hash = this.hash;
$('html, body').animate({
scrollTop: $(hash).offset().top
}, 800, function() {
window.location.hash = hash;
});
}
});
});
Key Features:
- 3D Effects: The
.service-box divs rotate on hover, creating a dynamic 3D effect.
- Smooth Scrolling: The jQuery script enables smooth scrolling when navigating through the page using the navigation bar.
- Modern Layout: The page uses a fixed, full-screen background with a gradient effect, making it visually appealing.
- Responsive Design: The layout adapts well to different screen sizes, ensuring usability on mobile devices.
- Animations: The text elements in the hero section fade in with a smooth animation, enhancing the user's first impression.
This template provides a modern, 3D-effect webpage with a right-aligned navigation bar, dynamic content sections, and an engaging user experience. You can modify colors, effects, and styles to match your specific requirements.