簡體   English   中英

是否可以設置用戶在聯系表單中輸入的文本字體的樣式

[英]Is it possible to style the text font that the user input in a contactform

我問這個是因為用戶在 textarea 中輸入的文本與其他字段不同。 字體樣式不同。 如何更改此字段區域的字體樣式? 首先,我想解決這個問題,然后如果可以設置樣式,我想學習如何設置。

 .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 */
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM