Heading tags and div tags
Please support our HTML and CSS advertiser: Programming Forums
![]() |
•
•
•
•
Originally Posted by cscgal
I would like to use <H1> and <H2> tags to emphasize important keywords for SEO purposes. Is it XHTML-transitional legal to enclose a <div class="blah"> tag inside an <h1> tag?
I believe it is, but why... You could just apply the class to the <h1> tag: <h1 class="blah"> or assign the style to it in your style sheet:
h1 { some-style:xxx; }
Then all <h1>'s would inherit that style...
Make sense? If you are after another result, please share.... I am curious.
JasonRCS
Always a work in progress...
Always a work in progress...
I'd prefer to use a span as it's inline. If you put a div in a h1 and put it into the wdg validator - http://www.htmlhelp.com/tools/validator/direct.html it fails, though for a reason I don't actually agree with. (h1 isn't inline to the best of my knowledge).
However the only reason I've used this sort of thing for is avoiding box model problems by putting width on one and margins one the other. Is there another use? :curious:
However the only reason I've used this sort of thing for is avoiding box model problems by putting width on one and margins one the other. Is there another use? :curious:
![]() |
Similar Threads
Other Threads in the HTML and CSS Forum
- About DIV tags (HTML and CSS)
- Confused & frustrated (IT Professionals' Lounge)
- <h1><h2> and <b> tags (Search Engine Optimization)
- Mayon Volcano (Website Reviews)
Other Threads in the HTML and CSS Forum
- Previous Thread: Displayed Text in MS Internet Explorer
- Next Thread: Layout in CSS
•
•
•
•
Views: 6726 | Replies: 2 | Currently Viewing: 1 (0 members and 1 guests)






Linear Mode