【发布时间】:2021-09-17 13:34:15
【问题描述】:
我想使用内部样式表而不是外部样式表,但由于某种原因,这些样式不适用于我的 HTML?
如何在不制作外部 CSS 表单或使用内联样式的情况下将我的样式应用到我的 HTML?
<!DOCTYPE html>
<html lang="en">
<head>
<title>Contact Us</title>
<style type=”text/css”>
form{
height: 350px;
width: 200px;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
background-color: red;
}
</style>
</head>
<body>
<header>
<h1>Contact</h1>
</header>
<nav></nav>
<main>
<h2>Send us feedback</h2>
<form action="" method="post" autocomplete="on">
<label for="fName">First name</label>
<input type="text" name="fName" placeholder="First name">
<label for="lName">Last name</label>
<input type="text" name="lName" placeholder="Last name">
<label for="email">Email</label>
<input type="email" name="email" autocomplete="off" placeholder="Email">
<label for="pNumber">Phone number</label>
<input type="number" name="pNumber" placeholder="Phone number">
<label for="comments">Comments</label>
<textarea name="comments" cols="" rows="" placeholder="Comments"></textarea>
<input name="submit" type="submit">
</form>
</main>
<footer></footer>
</body>
</html>
【问题讨论】: