Are body properties and * properties different?
I always use body and html properties the same way. Can I use * properties with body and html?
And what should be different in * versus body properties?
I don’t understand why it is necessary to use both these properties?
If I use one of them does it create any problems?
I use this
*{
margin:0;
padding:0;
background:#FFF;
}
and in body
body, html{
margin:0;
padding:0;
background:#FFF;
font:normal 12px verdana;
color:#0086ca;
}
when I use body, html it changes the background. When I remove background from * it didn’t change bg color.
*(Asterisk) – It is a wildcard, this means it will select all elements within that portion of the DOM.It’s a universal rule which affect on every element.
for example:
Margin every element on the page
All HTML components will have those attributes.
Body affects only on the body tag…The elements within the tag aren’t affected – (they are not getting the same attributes.)