ID the Body

Contact Us or call 1-877-932-8228
ID the Body

ID the Body

Using an id attribute on the body provides a hook into the page for your CSS selectors. The id needs to be unique for that page, but different pages on your website can share the same id. For example, you might set the id to "products" for all the pages in the products section of your web site. You can then precede rules specific to your products pages with #products, like this:

#products h1 { /*declarations go here*/ }

Note that your h1 elements will still inherit all the other h1 properties set elsewhere unless you explicitly override them.

Some developers prefer to use the class attribute rather than the id attribute. You can do either or both.

Next