html css网页制作模板

模板一:简约博客页面

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>简约博客</title>
  <link rel="stylesheet" href="style.css">
</head>

<body>
  <header>
    <h1>My Blog</h1>
    <nav>
      <a href="#">Home</a>
      <a href="#">About</a>
      <a href="#">Posts</a>
      <a href="#">Contact</a>
    </nav>
  </header>
  <main>
    <article>
      <h2>First Post</h2>
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
    </article>
    <article>
      <h2>Second Post</h2>
      <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
    </article>
  </main>
  <footer>
    <p>Copyright &copy; 2024</p>
  </footer>
</body>

</html>

对应的 CSS(style.css):

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
}

header {
  background-color: #333;
  color: white;
  padding: 20px;
}

header h1 {
  margin: 0;
}

nav {
  margin-top: 10px;
}

nav a {
  color: white;
  text-decoration: none;
  margin-right: 15px;
}

main {
  padding: 20px;
}

article {
  margin-bottom: 30px;
}

article h2 {
  margin-top: 0;
}

footer {
  background-color: #333;
  color: white;
  text-align: center;
  padding: 10px;
}

模板二:产品展示页面

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Product Showcase</title>
  <link rel="stylesheet" href="style.css">
</head>

<body>
  <header>
    <h1>Our Products</h1>
  </header>
  <main>
    <div class="product">
      <img src="product1.jpg" alt="Product 1">
      <h3>Product 1</h3>
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
    </div>
    <div class="product">
      <img src="product2.jpg" alt="Product 2">
      <h3>Product 2</h3>
      <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris.</p>
    </div>
    <div class="product">
      <img src="product3.jpg" alt="Product 3">
      <h3>Product 3</h3>
      <p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p>
    </div>
  </main>
  <footer>
    <p>Copyright &copy; 2024</p>
  </footer>
</body>

</html>

对应的 CSS(style.css):

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
}

header {
  background-color: #f0f0f0;
  padding: 20px;
}

header h1 {
  margin: 0;
}

main {
  padding: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.product {
  width: 30%;
  background-color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin-bottom: 20px;
}

.product img {
  width: 100%;
  height: auto;
  margin-bottom: 10px;
}

footer {
  background-color: #333;
  color: white;
  text-align: center;
  padding: 10px;
}

模板三:个人简历页面

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Resume</title>
  <link rel="stylesheet" href="style.css">
</head>

<body>
  <header>
    <h1>Your Name</h1>
    <p>Your Profession</p>
  </header>
  <main>
    <section>
      <h2>About Me</h2>
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
    </section>
    <section>
      <h2>Skills</h2>
      <ul>
        <li>Skill 1</li>
        <li>Skill 2</li>
        <li>Skill 3</li>
      </ul>
    </section>
    <section>
      <h2>Experience</h2>
      <h3>Company Name</h3>
      <p>Position</p>
      <p>Duration</p>
      <p>Description of work.</p>
    </section>
    <section>
      <h2>Education</h2>
      <h3>University Name</h3>
      <p>Degree</p>
      <p>Graduation Year</p>
    </section>
  </main>
  <footer>
    <p>Contact Information</p>
  </footer>
</body>

</html>

对应的 CSS(style.css):

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
}

header {
  background-color: #333;
  color: white;
  padding: 20px;
}

header h1 {
  margin: 0;
}

main {
  padding: 20px;
}

section {
  margin-bottom: 30px;
}

section h2 {
  margin-top: 0;
}

footer {
  background-color: #f0f0f0;
  padding: 10px;
}

模板四:美食博客页面

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Food Blog</title>
  <link rel="stylesheet" href="style.css">
</head>

<body>
  <header>
    <h1>Delicious Dishes</h1>
  </header>
  <main>
    <article>
      <img src="dish1.jpg" alt="Dish 1">
      <h2>Dish 1 Name</h2>
      <p>Description of dish 1.</p>
    </article>
    <article>
      <img src="dish2.jpg" alt="Dish 2">
      <h2>Dish 2 Name</h2>
      <p>Description of dish 2.</p>
    </article>
    <article>
      <img src="dish3.jpg" alt="Dish 3">
      <h2>Dish 3 Name</h2>
      <p>Description of dish 3.</p>
    </article>
  </main>
  <footer>
    <p>Copyright &copy; 2024</p>
  </footer>
</body>

</html>

对应的 CSS(style.css):

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
}

header {
  background-color: #f90;
  color: white;
  padding: 20px;
}

header h1 {
  margin: 0;
}

main {
  padding: 20px;
}

article {
  margin-bottom: 30px;
}

article img {
  width: 100%;
  height: auto;
  margin-bottom: 10px;
}

article h2 {
  margin-top: 0;
}

footer {
  background-color: #f90;
  color: white;
  text-align: center;
  padding: 10px;
}

模板五:旅游网站页面

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Travel Site</title>
  <link rel="stylesheet" href="style.css">
</head>

<body>
  <header>
    <h1>Explore the World</h1>
    <nav>
      <a href="#">Destinations</a>
      <a href="#">Travel Tips</a>
      <a href="#">About Us</a>
    </nav>
  </header>
  <main>
    <section>
      <img src="destination1.jpg" alt="Destination 1">
      <h2>Destination 1</h2>
      <p>Description of destination 1.</p>
    </section>
    <section>
      <img src="destination2.jpg" alt="Destination 2">
      <h2>Destination 2</h2>
      <p>Description of destination 2.</p>
    </section>
    <section>
      <img src="destination3.jpg" alt="Destination 3">
      <h2>Destination 3</h2>
      <p>Description of destination 3.</p>
    </section>
  </main>
  <footer>
    <p>Copyright &copy; 2024</p>
  </footer>
</body>

</html>

对应的 CSS(style.css):

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
}

header {
  background-color: #007bff;
  color: white;
  padding: 20px;
}

header h1 {
  margin: 0;
}

nav {
  margin-top: 10px;
}

nav a {
  color: white;
  text-decoration: none;
  margin-right: 15px;
}

main {
  padding: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

section {
  width: 30%;
  background-color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin-bottom: 20px;
}

section img {
  width: 100%;
  height: auto;
  margin-bottom: 10px;
}

footer {
  background-color: #007bff;
  color: white;
  text-align: center;
  padding: 10px;
}

猜你喜欢

转载自blog.csdn.net/m0_54829066/article/details/142062588