html网页制作美化
时间: 2023-12-09 10:04:23 浏览: 37
以下是制作美化HTML网页的步骤:
1. 创建HTML文件并添加内容,例如:
```html
<!DOCTYPE html>
<html>
<head>
<title>My Beautiful Webpage</title>
</head>
<body>
<h1>Welcome to my webpage!</h1>
<p>This is a paragraph of text.</p>
<img src="image.jpg" alt="An image">
</body>
</html>
```
2. 创建CSS文件并添加样式,例如:
```css
body {
background-color: #f2f2f2;
font-family: Arial, sans-serif;
}
h1 {
color: #333;
text-align: center;
}
p {
color: #666;
font-size: 18px;
}
img {
display: block;
margin: 0 auto;
max-width: 100%;
}
```
3. 在HTML文件中引用CSS文件,例如:
```html
<!DOCTYPE html>
<html>
<head>
<title>My Beautiful Webpage</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<h1>Welcome to my webpage!</h1>
<p>This is a paragraph of text.</p>
<img src="image.jpg" alt="An image">
</body>
</html>
```
4. 根据需要添加更多的HTML元素和CSS样式来美化网页。