One Rule To Rule Them All
Here's a quick tip for anyone wanting to easily apply a rule to all of the elements within a design. Just use
* {
whatever: whatever;
}and you can target everything within your design, as the * selector is universal.
But what's a practical use for this?
Well, anyone who uses CSS knows how annoying it can be to try and get all of the margin and padding correct, and make it look the same across different browsers.
This can be especially tricky when you consider that, before you've even written one line of code, your browser is applying its own default CSS styles. This is because all browsers have their own in-built style sheets which, whilst they may be quite basic, will affect your design.
So a simple tip is to clear out any external margin and padding before you start. To do this just use the following code at the top of your style sheet:
* {
margin: 0;
padding: 0;
}This zeros out the margin and padding on all elements and gives a nice clean starting point, making it (hopefully;) ) easier to diagnose any future problems.





Hi, I'm Laurence and this is my Drupal blog.
Don't Make Me Think!
Pro Drupal Development
PHP Cookbook
Will You Please Be Quiet, Please?
Hello
So true. And not onyl for drupal, but for any site...
Post new comment