Forum Moderators: open

Message Too Old, No Replies

How much markup in a <h2> tag is too much?

Styling header text

         

JenLN79

4:41 pm on Sep 11, 2006 (gmt 0)

10+ Year Member



The only on-page text in here is our company name and tagline. However, we wanted to use the h2 tag, but maintain a certain look, so we included quite a bit of extra code. Is this too much?

<h2 class="afc">&nbsp;<strong style="font-size: 17px;">CompanyName</strong>
<img src="/images/spacer.gif" alt="" style="background-color: rgb(0, 52, 118);" height="1" vspace="0" width="375"><br>
<span style="margin-left: 50px;">America's First Choice for</span><br>
<span style="margin-left: 50px;">ThreeTopProductCategories.<font size="2"> <sup>SM</sup></font></span>
</h2>

kaled

5:36 pm on Sep 11, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Opinions will differ, however, I would say that if you need to use <br> then you're probably putting too much in the heading.

If you're hoping for better SERPS by using <hx> tags to contain a lot of text, you will probably be disappointed.

Kaled.

JenLN79

6:43 pm on Sep 11, 2006 (gmt 0)

10+ Year Member



The thing is, that whole string *can* fit on one line. But the client prefers how it looks on two different lines with a horizontal rule in between.

Yes, I was hoping the h2 tag would give a boost in the SERPs. But this bit of text will remain at the top of the home page, in large font one way or the other. I just figured it would be better off in the h2 for SE purposes....but now all this extra code is making me wonder.

So best bet: a) regular font, in <strong>, b) <h2> with the extra formatting (as seen above), or c) <h2> but convince client it must be done without line breaks, the horizontal rule, etc.?

pageoneresults

6:59 pm on Sep 11, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



But this bit of text will remain at the top of the home page, in large font one way or the other.

Hmmm, there should be an <h1> above that, is there?

JenLN79

8:45 pm on Sep 11, 2006 (gmt 0)

10+ Year Member



I thought if you alter the style to be too different from the actual font size of the <hx> tag, it might look spammy. Not true?

OK, if I change to h1, then which option, a, b or c?

pageoneresults

8:55 pm on Sep 11, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



<h1> and style it through an external stylesheet. That way you don't have all that inline code bloat.

tedster

9:10 pm on Sep 11, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I thought if you alter the style to be too different from the actual font size of the <hx> tag, it might look spammy. Not true?

That's a very widespread piece of crazy thinking being spread by too many people these days. Don't believe them at all. And don't even try to argue with them, either, just go back to coding. Of course, if you make an h1 element render in a 2px font or something like that, it becomes "hidden text" and it would not pass a hand check by a search engine. But you can style REAL h1 headers however you like so that they look good on the page.

OK, if I change to h1, then which option, a, b or c?

Just get as much of that special styling out of the inline html as possible. And maybe rethink the approach: isn't this actually two elements rather than one? Possibly H1 and H2? Maybe the second line isn't really a second level head at all, unless some information follows. Maybe it's just a tagline, no?

I'd also suggest replacing the horizontal rule with a text-decoration:underline rule. I'd aim for the following inline html:

<h1>CompanyName</h1>
<h2>America's First Choice for ThreeTopProductCategories</h2>

You can place all the css rules for h1 and h2 in the <head> section or in an external .css file. You might even force an automatic line break by giving H2 a width rule.

SuzyUK

9:26 pm on Sep 11, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I thought if you alter the style to be too different from the actual font size of the <hx> tag, it might look spammy. Not true?

true or not, it would be presuming that bots can actually parse and contextualize a stylesheet

use the HTML as would be logical to do so and style to your hearts content

If I have a page with a heading and subheading (tagline).. where would you put the break? In the middle of the top heading or between the two of them?

[edit] too slow tedster said it more succinctly

[edited by: SuzyUK at 9:47 pm (utc) on Sep. 11, 2006]

JenLN79

10:12 pm on Sep 11, 2006 (gmt 0)

10+ Year Member



tedster, that approach sounds good, thanks. Don't know why it never occured to me to use two different tags....probably because my personal preference was to have it all on one line.

Thanks again!