我这样问是因为用户在文本区域中输入的文本与其他字段中的文本不同. 字体样式不同.如何更改为该字段区域的字体样式? 首先,我想修复它,之后,如果造型是可能的,我想学习如何.

.contact-form {
  background-color: white;
}

input,
select,
textarea {
  background-color: #f2f2f2;
  display: block;
  margin: auto;
  font-size: 1em;
  padding: 25px;
  border: none;
  outline: none;
  margin-top: 20px;
  margin-bottom: 16px;
  box-sizing: border-box;
  resize: vertical;
}

input[type=submit] {
  font-family: avenir_nextdemi_bold;
  background-color: #437bff;
  font-size: 1.2em;
  color: white;
  padding: 12px 20px;
  border-radius: 30px;
  width: 15%;
  border: none;
  cursor: pointer;
}

input[type=submit]:hover {
  background-color: #133edb;
}

 ::placeholder {
  font-family: avenir_nextdemi_bold;
}

textarea {
  height: 200px;
}
<form action="/action_page.php">
  <input type="text" id="lname" name="lastname" placeholder="Naam" required>
  <input type="email" id="email" name="email" placeholder="Email adres" required>
  <textarea id="subject" name="subject" placeholder="Vertel ons over je project" required></textarea>
  <input type="submit" value="Submit">
</form>

推荐答案

您所需要做的就是添加Font-Family:sans-serif;下面是它在代码中的样子:

input,
select,
textarea {
  background-color: #f2f2f2;
  display: block;
  margin: auto;
  font-size: 1em;
  padding: 25px;
  border: none;
  outline: none;
  margin-top: 20px;
  margin-bottom: 16px;
  box-sizing: border-box;
  resize: vertical;
  font-family: sans-serif;
  /* You can change the font if you want but based on what I saw I assumed
  you wanted sans-serif. It would also be helpful for you to specify what you mean
  style text */
}

Html相关问答推荐

HTML CSS如何使用图像作为中心点将元素置于中心

在浮动元素旁边垂直居中

HTML表行悬停仅适用于偶数行

为什么在移动视图中,这个水平可滚动的表格会在表格的右侧显示额外的空间?

我怎样才能在我的网站上制作花哨的角落

Html视频标签:圆角像素化

文本css后面未显示背景 colored颜色

如何在Go模板中传入途中创建的 map

标题在实时网站上闪烁

当多个a元素用作目标时的:target伪类

margin-top 未应用于无序列表的第一项

悬停时宽度从 0 过渡到自动

如何配置 prettier 使其以 Vue.js 模板语法的特定方式运行?

如何让一个 div 始终贴在容器的边缘?

CSS 随着内容宽度的增加而减少填充

高度大于页面高度和页面大于覆盖的 CSS 覆盖

如何在div中设计伪元素?

辅助功能:alt 或 alt="" 用于装饰图像

HTML 标记未在页面上展开

标题之间和之后的 Hr 线