What is default font style of textarea in chrome? (text input vs textarea “size” of text)

孤人 提交于 2019-12-10 14:45:00

问题


What is default font style of textarea in chrome? What should to make it default look like? Purpose of my question is that I wanna make the text make same in input as in textarea. In text input is maybe too "bold" :P
The question should be: What are default font properties applied on textarea? What would I wrote if I wanna look like as default?

textarea {
font-???: ???;
etc.
}

回答1:


To answer your question directly,

The default font property of a textarea is font-family: monospace

While the default font property of a input is font-family: Arial.

All the default styling properties of an element (in Chrome) can be found by looking at the computed styling of the element in the Chrome developer tool. For all the properties, view this (example)




回答2:


As mentioned in another answer, you can force textarea to inherit the font style, to make it look like default:

textarea {
  font-family: inherit;
}


来源:https://stackoverflow.com/questions/20013784/what-is-default-font-style-of-textarea-in-chrome-text-input-vs-textarea-size

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!