Web Design Forum: Asterisk in CSS code - Web Design Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Asterisk in CSS code

#1 User is offline   kyme 

  • Forum Newcomer
  • Pip
  • View blog
  • Group: Members
  • Posts: 39
  • Joined: 03-December 08
  • Experience:Beginner
  • Area of Expertise:Designer

Post icon  Posted 09 February 2009 - 10:18 PM

hello,
I'm confuse putting about asterisk in the beginning of the CSS code. For example

Quote

-->> * {
margin:0 auto;
padding:0 auto;


}
body{

background:#CCCCCC;
}


Is it necessary to put some asterisk in the beginning of the body of CSS?
even i don't have some IE hack in my code or some errors?

Because usually i notice of some people, when they develop their CSS code, they have putted some
asterisk in the beginning of the body like a sample above in that red asterisk.

Now my question is;
1.) Seems i don't have some IE hacks or some code hacks for IE6 & 7.
Is it necessary to put some asterisk in the beginning of the body of CSS?

2.) Is it required for validating in w3.com?

0

#2 User is offline   Dizi 

  • Queen of the Spammers
  • PipPipPipPipPipPip
  • View blog
  • View gallery
  • Group: Members
  • Posts: 5,218
  • Joined: 13-August 07
  • Gender:Female
  • Location:Newcastle, UK
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 09 February 2009 - 10:29 PM

* {
margin:0 auto;
padding:0 auto;
}


Is a global reset of all margins and paddings in all browsers, as different browsers have different margins and paddings as default. So some people use the above code at the beginning of the css so that they don't have to worry about margins and paddings in different browsers looking different. So all the * does is says do this to everything.


So no it isn't needed in the css, and there are other ways to reset things without doing a global rest, it also isn't required to make your css valid.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users