SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2001
    Location
    London, UK
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    css and <H1> tag

    Is there any way to stop a heading tag from going onto a new line?

    ie when i type:

    This <H1>is</H1> a sentence

    I want it to come out as:

    This is a sentence

    rather than:

    This
    is
    a sentence

  2. #2
    SitePoint Addict Caterwomtious's Avatar
    Join Date
    Dec 2001
    Posts
    222
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    h1 {display:inline;}

    ...will do the trick. However, I can't imagine a situation where <h1> would be the appropriate tag for this purpose. Is a word in the middle of your sentence really the main heading of the page, or should you be using <strong> or <em> instead?

  3. #3
    SitePoint Enthusiast
    Join Date
    Apr 2001
    Location
    London, UK
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks! been trying to find that out for a long time.

    BTW, Im putting it around keywords in my content, for search engine optimisation
    Last edited by Shaq; Mar 8, 2002 at 16:10.

  4. #4
    SitePoint Wizard Ian Glass's Avatar
    Join Date
    Oct 2001
    Location
    Beyond yonder
    Posts
    2,384
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Shaq
    BTW, Im putting it around keywords in my content, for search engine optimisation
    Hummm... I'm going to yell at you, now. :-(

    That's not search engine optimization -- it's spaming! You're artificially manipulating your document flow to mislead the search engines and that'll probably get you in hot water with 'em sooner or later (they could ban you for it). Search engines are smarter than most people give them credit for and the people at the companies catch on pretty quick.

    Additionally, it undermines the purpose of having CSS and HTML separate. Separating style from markup isn't worth anything when you use stylesheets to circumvent the markup standards and rules. Plus, it makes your pages unnecessarily confusing to anyone who isn't browsing around with a CSS capable browser.

    Anyway, I hope I haven't offended you, but this technique simply isn't worth the amount of damage you're doing.

    ~~Just My 2

  5. #5
    SitePoint Addict Caterwomtious's Avatar
    Join Date
    Dec 2001
    Posts
    222
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have to agree with Ian - that's really not a good idea.

    There's also the issue of accessibility to consider. Not everyone browsing the web relies on the visual appearance you present on screen - there are millions who rely on the tags behind the scenes to interpret the page, and they'll be running away from your site in droves.

  6. #6
    Posts rarely lloydi's Avatar
    Join Date
    Jan 2002
    Location
    Swindon UK
    Posts
    620
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hear Hear! We managed to drag that one out of the guy eventually. Let's send the boys round there with a few bats with rusty nails in
    Build Your Own Web Site the Right Way!
    A beginners' HTML/CSS book with web standards at its heart
    The Ultimate HTML Reference
    A complete reference, in glorious hardback


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
  •