CSS样式添加到你的HTML文件的<head>标签
时间: 2023-12-06 22:03:12 浏览: 114
html的css样式
可以直接在<head>标签内添加<style>标签,并将CSS样式写在其中,如下所示:
```html
<!DOCTYPE html>
<html xmlns="">
<head>
<meta charset="UTF-8">
<title>Webmail客户端</title>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
</style>
</head>
<body background="R-C.jpg">
<h1>Email Sender</h1>
<form action="deal_email.php" method="POST">
<label for="from_email">Sender's Email:</label>
<input type="email" id="from_email" name="from_email" required><br><br>
<label for="passward">Password:</label>
<input type="password",id = "password" name="password"><br><br>
<label for="to_email">Receiver's Email:</label>
<input type="email" id="to_email" name="to_email[]" required>
<button type="button" id="add_email">Add</button><br><br>
<label for="title">Title</label><br>
<input type="text" id="title" name="title" required><br>
<label for="email_content">Message:</label><br>
<textarea id="email_content" name="email_content" rows="10" cols="50" required></textarea><br><br>
<button type="submit">Send Email</button>
</form>
<script>
var addEmailButton = document.getElementById("add_email");
addEmailButton.addEventListener("click", function() {
var emailList = document.createElement("input");
emailList.setAttribute("type", "email");
emailList.setAttribute("name", "to_email[]");
emailList.setAttribute("required", "");
document.getElementById("to_email").insertAdjacentElement("afterend", emailList);
});
</script>
</body>
</html>
```
这样整个页面就会居中显示了。
阅读全文