/    Sign up×
Community /Pin to ProfileBookmark

how to disable the return carrige of H1 tag

sorry to double-shoot you guys tonight, but this one has been buggin’ the piss out of me for quite some time and wanted to ratter yer cages ’bout it.

i would like to tag up some words/phrase in-line of paragraph text but, of course, when teh H1,2,3….. tags are used, the return-carriage is executed.

any ideas?

-grant

to post a comment
CSS

22 Comments(s)

Copy linkTweet thisAlerts:
@TheBearMayFeb 18.2006 — <h1 style="display:inline">....</h1>
Copy linkTweet thisAlerts:
@smallfishauthorFeb 18.2006 — no dice Bearman,

i tried it and here's what happened:

1. the h1 taged word was in fact in line as desired, but

2. the word there afterwards returned to the next line with a line break and the <p></p> block element was broken.

did i do it wrong?

thanks

grant
Copy linkTweet thisAlerts:
@ray326Feb 18.2006 — There's not enough context to tell.
Copy linkTweet thisAlerts:
@smallfishauthorFeb 18.2006 — to boil it down....

my goal is to assign the importance of the <h1> tag to a word/phrase inside of a <p> block element without the <h1> tag causing a break in flow of the sentence.

is it possible?
Copy linkTweet thisAlerts:
@bathurst_guyFeb 18.2006 — like [url=http://sdstudio.com.au/webdeveloper/smallfish.htm]this[/url]&lt;p style="display: inline;"&gt;The start of the paragraph&lt;h1 style="display: inline;"&gt;The Heading&lt;/h1&gt;The end of the paragraph&lt;/p&gt;
Copy linkTweet thisAlerts:
@smallfishauthorFeb 18.2006 — DING! DING! DING!

we've got a winner. Thanks Bathurst_guy. the double display:inline did the trick. thanks for the help.

-grant
Copy linkTweet thisAlerts:
@NogDogFeb 18.2006 — like [url=http://sdstudio.com.au/webdeveloper/smallfish.htm]this[/url]&lt;p style="display: inline;"&gt;The start of the paragraph&lt;h1 style="display: inline;"&gt;The Heading&lt;/h1&gt;The end of the paragraph&lt;/p&gt;
[/QUOTE]

Note, however, that it is invalid HTML. The following will validate, though:
[code=html]
<p style="display: inline;">The start of the paragraph</p>
<h1 style="display: inline;">The Heading</h1>
<p style="display: inline;">The end of the paragraph</p>
[/code]

(The problem is that a <p> is assumed to be complete when the parser encounters the <h1>, so you need to start another <p> after </h1>.)
Copy linkTweet thisAlerts:
@felgallFeb 18.2006 — That of course produces completely garbage HTML. Why not use SPAN instead of H1 and assign it the appropriate stylesheet options to get the required appearance. That way you will have the look you want and also valid HTML.

Where you find yourself needing to change the display settings between block and inline then you are definitely trying to use the wrong tag.
Copy linkTweet thisAlerts:
@KravvitzFeb 18.2006 — Where you find yourself needing to change the display settings between block and inline then you are definitely trying to use the wrong tag.[/QUOTE]
In this case, yes, and probably in most other cases, but what about adding display:block to an <a> element so that it takes up the full width of a list-item (<li>)?
Copy linkTweet thisAlerts:
@smallfishauthorFeb 18.2006 — which phrase would get more recognition from a search engine:

a) <h1>Arabian Horse</h1>, or

b)<span class="important phrase">Arabian Horse</span>?
Copy linkTweet thisAlerts:
@KravvitzFeb 18.2006 — SEO should not have a higher priority to semantically and structurally correct markup.
Copy linkTweet thisAlerts:
@NogDogFeb 18.2006 — I don't know for sure, but if I were writing the rating algorithm I would do something like divide the importance of each H1 tag by the number of H1 tags on the page, specifically to penalize such abuse (just like they now penalize you for ridiculous numbers of keywords in the meta tags).
Copy linkTweet thisAlerts:
@smallfishauthorFeb 18.2006 — GREAT, now that we've all ascended our mountains, can we get back to task at hand.

  • 1. i validate all my pages (then throw in some quirks for fun)

  • 2. i can and do code to the W3C's strict standards

  • 3. do not [i]abuse[/i] SEO.


  • in theory, only having H1 tags outside of P tags is great. but in practice, sometimes the design does not allow that to happen, so instead of penalizing my client, i am using the right side of my brain to figure a way around it.

    hope this clears the air.
    Copy linkTweet thisAlerts:
    @NogDogFeb 18.2006 — I understand exactly what you're doing. The question is, do the people at Google understand it too? If so, do they actually penalize you for it instead of rewarding you? I don't know the answer. I was just saying that if I were writing the rating code, you would not be rewarded for such non-semantic use of multiple H1 tags as an obvious attempt to artificially increase search engine ranking. [i][b]IF[/b][/i] the Google developers do penalize such abuse, then you possibly could be doing your client a disservice by over-using the H1 tag. Again, I don't [i]know[/i] if they do, I'm just suggesting you make sure before taking the risk. Or perhaps they don't penalize it now, but will in the not-too-distant future (just like they now penalize text with the same color as the background, large numbers of keywords in meta tags, and other "tricks" people have come up with in the past to achieve artificially inflated rankings).
    Copy linkTweet thisAlerts:
    @NogDogFeb 18.2006 — PS: If you go ahead with this technique, you might want to view the results with CSS disabled or in a non-CSS browser. Accessibility issues might be another reason to avoid this.
    Copy linkTweet thisAlerts:
    @DaveSWFeb 18.2006 — Personally I'd use strong or em tags which are good for SEO and accessibility.
    Copy linkTweet thisAlerts:
    @pcthugFeb 19.2006 — The text placed in H1 tags (Any heading tag infact) is seen as more important and valuable then the remaing text by the SE,
    Copy linkTweet thisAlerts:
    @DaveSWFeb 20.2006 — yes but if using them like this were to get your site banned then it defeats the point doesn't it?

    At least search engines can't possibly object to strong and em tags.
    Copy linkTweet thisAlerts:
    @pcthugFeb 21.2006 — I would see it very hard for any SE to blacklist sites just for the incorrect use of <h#> tags, especially as spiders only consider [I]Heading-text[/I] to be more important then the remaining text - Little to no remaing text would mean that [I]Heading-text[/I] would lose all value.
    Copy linkTweet thisAlerts:
    @WebJoelFeb 22.2006 — like [url=http://sdstudio.com.au/webdeveloper/smallfish.htm]this[/url]&lt;p style="display: inline;"&gt;The start of the paragraph&lt;h1 style="display: inline;"&gt;The Heading&lt;/h1&gt;The end of the paragraph&lt;/p&gt;
    [/QUOTE]



    -This works? I thought that enclosing a block-level element in an inline element throws a validator error. To my belief, one cannot enclose an <h>~</h> inside a <p>~</p> tag. Or does adding style="display:inline;" override that somehow?
    Copy linkTweet thisAlerts:
    @NeczyFeb 22.2006 — [font=trebuchet ms]I understand that you really [i]want[/i] to use the <h1> tag, but I agree with NogDog/Dave that an <em> or <strong> tag would be the best option for this situation; you use less CSS and if CSS is disabled the page won't lose any of its semantic value.[/font]
    Copy linkTweet thisAlerts:
    @NeczyFeb 22.2006 — [font=trebuchet ms]NogDog already mentioned that- yes, it isn't valid.[/font]

    Note, however, that it is invalid HTML[...][/QUOTE]
    ×

    Success!

    Help @smallfish spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 6.15,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @nearjob,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,
    )...