View Full Version : Define <h1> tag
geoffb
12-29-2006, 08:18 AM
Hi all,
I want to difine my <h1> tag so it blands with original text already on the page. I have set size rules and looks great BUT it displays on it's own line as if it has margins around it or something.
ie: code is like
Hello all of you, I am a <h1>solicitor</h1> but I am not really.
Displays like this:
Hello all of you, I am a
solicitor
but I am not really.
Here (solicitor) is displayed on it's own line.
Please help.
Geoff:confused:
RoniM
12-29-2006, 08:31 AM
As far as I know, <h> tags will always display in one line.
Sorry for the bad news.
By default, <h1> is a block-level element. You can change this by setting:
display: inline;... or by floating it. However, the example use you have given above is an abuse of the element. For a start, text must be contained within another element, usually <p>:
<p>Hello all of you, I am a <h1>solicitor</h1> but I am not really.</p><h1> and friends are invalid inside a paragraph (I suggest you see http://validator.w3.org/).
Why exactly do you want to do this? There's probably another element that would be more appropriate.
JohnK
12-29-2006, 01:26 PM
I agree with Twey. You would probably want to use an inline tag here such as <span>. You could then apply any inline properties via css.
geoffb
12-30-2006, 12:16 PM
thanks for all replies. i wanted to use header tags within a ,<p></p> as part of keywords for optimisation purposes.
this was my thinking.
any more advice.
geoff
i wanted to use header tags within a ,<p></p>You can't. Again, see the validator (http://validator.w3.org/). Also, it would be a rather nasty case of element abuse.
Don't worry about SEO. If you need to include extra keywords or add emphasis to things, then the chances are you haven't written your page properly. The emphasis seen by the search engine should be the same as the emphasis seen by a human user.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.