Results 1 to 6 of 6

Thread: Define <h1> tag

  1. #1
    Join Date
    Sep 2006
    Location
    Liverpool UK
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Define <h1> tag

    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

  2. #2
    Join Date
    Dec 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    As far as I know, <h> tags will always display in one line.

    Sorry for the bad news.

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    By default, <h1> is a block-level element. You can change this by setting:
    Code:
    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>:
    Code:
    <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.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #4
    Join Date
    Feb 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.

  5. #5
    Join Date
    Sep 2006
    Location
    Liverpool UK
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    i wanted to use header tags within a ,<p></p>
    You can't. Again, see the validator. 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.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •