Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to theorize about this phenomenon about <div> tag

Tags:

html

css

My understanding about CSS is that, generally if you set <div style="color: Red">, all content inside <div> will be affected. However if you put a html button inside, the color on the words on the button is not affected. I'm a bit disturbed by this exception. How do I give a reasonable explanation to it?

like image 350
Aperture Avatar asked Sep 29 '10 10:09

Aperture


1 Answers

It's about users' expectations of the user interface.

Buttons (and other user interface widgets) prefer to look like their operating system counterparts. On Windows, users expect buttons to be grey with black text, so that's how browsers present them. It's intentional that you have to try quite hard to override that behaviour.

like image 111
RichieHindle Avatar answered Oct 13 '22 01:10

RichieHindle