View Single Post
Old 05-09-2011, 06:24 PM   PM User | #4
teedoff
Senior Coder

 
Join Date: Aug 2010
Location: High Point, NC
Posts: 3,325
Thanks: 5
Thanked 363 Times in 360 Posts
teedoff is on a distinguished road
Quote:
Originally Posted by AndrewGSW View Post
It is preferable to use h1 tags for your main headings, and h2 for sub-headings, etc. for:

Search Engine Optimization
Accessibility
Clarity


You can either give your various sections id numbers and target the headings within these:
Code:
#mainContent h1 { /* rules here */ }
or use class names for either the sections (preferred) or each heading:
Code:
.contentClass h1 { /* rules to apply to headings within sections with this class */ }
h1.headingClass { /* rules to apply to all heading 1's with this class */ }
To add a class to a div:
Code:
<div class="contentClass"><h1>My Main Heading</h1></div>
Yes I know, which is why I was pointing out there are lesser heading tags to be used for things like blog posts titles and such. Obviously, its good SEP practice to use heading 1 tags for page content headings, but less important sections dont have to be h1 tags.
__________________
Teed
teedoff is offline   Reply With Quote