how to display h1 inline

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sue miller
    New Member
    • Dec 2011
    • 1

    how to display h1 inline

    I want to code a sentence on my website where one word in the middle of the sentence is actually an h1 tag.

    Is there any code I can use that will be cross browswer to create this effect?
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    An h1 element is a heading and not part of a sentence so you are not allowed to do this.

    Comment

    • angiko
      New Member
      • Oct 2011
      • 3

      #3
      You can write CSS like this:

      h1{display:inli ne;}

      Comment

      • Atli
        Recognized Expert Expert
        • Nov 2006
        • 5062

        #4
        You may as well just use <span> or <strong> tags and use CSS to make it look like a H1 tag.

        Like drhowarddrfine says, the H1-H6 tags are used to specify headers. How does it make sense to put a header into the middle of a sentence?

        Unless you are doing this as a SEO trick? If so, I wouldn't bother. It's an old trick that the search engines are well aware of. - The <strong> tags, by the way, are the "natural" way to emphasize words inside a sentence. If the search engines are likely to increase your rankings based on a word within a sentence, those would be the tags to use.

        Comment

        • hellodipak
          New Member
          • Jun 2010
          • 26

          #5
          h1{
          display: inline-block;
          width: 100px;
          }

          OR

          h1{
          float: left;
          width: 100px;
          }

          Comment

          Working...