•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the HTML and CSS section within the Web Development category of DaniWeb, a massive community of 391,557 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,694 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our HTML and CSS advertiser: Lunarpages Web Hosting
Views: 5334 | Replies: 2
![]() |
•
•
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 10,879
Reputation:
Rep Power: 32
Solved Threads: 106
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?
Dani the Computer Science Gal
Do you run a computer-related website? Feature it in our niche link directory!
Do you run a computer-related website? Feature it in our niche link directory!
•
•
•
•
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:
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb HTML and CSS Marketplace
- About DIV tags (HTML and CSS)
- Confused & frustrated (Web Developers' 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



Linear Mode