Why are CSS-styles not inherited by HTML form fields?

前端 未结 4 680
挽巷
挽巷 2020-12-03 23:42

I want to set the font-style and font-size of the text in my HTML document.



    Style inheritance
    &l         


        
4条回答
  •  既然无缘
    2020-12-04 00:14

    This is because they are user interface elements which by default take the look and feel of the user's operating system. At least, they used to. Nowadays different browsers use different default styles, but they generally tend to be very similar.

    Anyways, the idea is to allow website owners to modify the look around the interface elements while still maintaining the user's default look of the input elements. Forcing you to change the styles separately is the only way to do that.

提交回复
热议问题