Free Search Engine Visibility Report

Newsletter Sign Up

First Name:

Last Name:

Email:

 

Free Resources

New MoreVisibility Webinars Complimentary Webinar
 
SEO: Google Mayday & Caffeine
 

Universal Selector in CSS

January 25th, 2010 by Shawn Escott

All browsers have built-in margins and padding for html and can impact the meticulous layout of a design. Browsers such as Internet Explorer, Firefox, and Safari may all render the spacing of the H1, p, ul, li,etc. differently.

To alleviate this problem and force the design to the margins and padding we specify, we must first set all of them to 0 pixels. This cancels out browser defaults. Now we can set our own heights and widths where needed. Below are two ways to accomplish this:

1. List all elements of the html and set the margin and padding to 0 pixels like this:

body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, form, fieldset, input, p, blockquote, th, td {
margin:0;
padding:0;
}

- OR -

2. Use the Universal Selector which does the same as above, but in much lest code.

* {
margin:0;
padding:0;
}

Keeping your code clean and simple can decrease file size and ensure your pages load quickly.

Posted in SEO & Design

Comments are closed at this time.


Subscribe rss feed Login or Register

Recent Articles

Article Categories

Articles by Month

Related Sites


Inc 5000 Google Analytics Authorized Consultant Google Qualified Company Yahoo Certified Ambassador Microsoft adExcellence Member Greenified 2009

MoreVisibility
925 South Federal Highway, Suite 750
Boca Raton, Florida 33432, USA

800.787.0497

ph: 561.620.9682

fx:  561.620.9684


© 1999 - 2010 MoreVisibility ® All Rights Reserved. Privacy | Legal

MoreVisibility Social Networking Links YouTube LinkedIn Facebook Twitter