homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

using a h1 tag in the body
using a h1 tag in the body without wrap

 12:32 pm on Feb 8, 2008 (gmt 0)

I'm trying to use a h1 tag in the body of some text but I don't want the next part of the text to wrap down to the next line. I read a bunch of post and tried using the display: inline attribute but the text still wraps. You can see an example here:

<div id="headinlinetext">
<h2>Our Church, Milford Ohio</h2> is a
<h2>non-denominational Christian Church </h2> that is dedicated to serving the community on the
<h2>eastside of Some Place</h2>.&nbsp; We have tried to put a great deal of information on the site so you can learn about Example Church in the comfort of your home.&nbsp; Don't hesitate to ask questions though.<br>

You can see the "Our Church, Milford Ohio is a non-denominational Christian Church" is using the h1 tag but the text after it drops down to the next line.

Is my CSS wrong or is there a better way to accomplish this?


[edited by: SuzyUK at 10:07 pm (utc) on Feb. 8, 2008]
[edit reason] uri removed, examplified code added [/edit]



 12:38 pm on Feb 8, 2008 (gmt 0)

don't post your links here - <snip>

try using the css:

h1 {display: inline;}

[edited by: SuzyUK at 10:09 pm (utc) on Feb. 8, 2008]
[edit reason] tidying, moderating talk by PM thanks.. [/edit]


 2:10 pm on Feb 8, 2008 (gmt 0)

In your html take the </div> after the </h1> out and put it after the next <br>.

That works in a mysterious way.


 3:39 pm on Feb 8, 2008 (gmt 0)

Thanks putting the </div> at the end worked like a champ. I don't know why I didn't see that before.

Sorry about the link. I will try to edit the post but I don't think it will let me.

Thanks again


 10:26 pm on Feb 8, 2008 (gmt 0)

Hi webharvest, please no links [webmasterworld.com] :)

I've edited it out now, but you can see that the code I replaced the link with is the "fixed" code - this is one reason we don't do links here in the code forums as now the discussion doesn't make much sense to anyone else

However, I've left it up because.. isn't there still something wrong with this?


 1:33 am on Feb 9, 2008 (gmt 0)

h2 tags (or any h1-h6) shouldn't they be used for titles?

It feels from the snipped text, that you're trying to use it as an alternative to <strong> or <b> (<b> 's back in grace since the HTML5 draft)

While adding additional <hX> tags is a SEO tactic, I 'm afraid overdoing it will only backfire.


 8:58 pm on Feb 9, 2008 (gmt 0)

Sorry to dig this one back up but I can't figure out why I can't set a div id called "inlinetexth1" and then set it to display inline. When I try this the h1 tags inside the inlinetexth1 dive it picks up the formatting of the lines above it under the h2,.contentheading, h1.contentheading CSS Formatting. I copied the code and part of my CSS file below:

</div> <div id="mainbody">
<table class="blog" cellpadding="0" cellspacing="0"><tr><td valign="top"><div>
<table class="contentpaneopen">

<td valign="top" colspan="2">
<br />
<div align="left">
<span class="contenttopheading">
We are glad you decided to visit our website.</span>
<div id="inlinetexth1">
<h2>Our Church, Milford Ohio</h2> is a
<h2>non-denominational Church </h2> that is dedicated to serving the community on the

<h2>eastside of City OH</h2>.&nbsp; We have tried to put a great deal of information on the site so you can learn about Our Church in the comfort of your home.&nbsp; Don't hesitate to ask questions though.<br />
<div align="left">
<span class="contenttopheading"><br />
Where should I begin?&nbsp;</span> - Start at the New to HPCC? menu link above.&nbsp; You will find a lot of great information!
<div align="left">



#pathway_div {

h1,h2,h3,h4,h5,h6,p,blockquote,form,label,ul,ol,dl,fieldset,address,.componentheading,.contentheading, h1.contentheading, h1.componentheading {
padding:5px 0px 0px 0px;

li,dd {
margin-right:1em; /*for docman */

fieldset {

a {
color: #004F9E;
text-decoration: underline;

a img {
border-style: none;

#content a {
border: 0px solid #ffffff!important; /* for edit images */

a:hover {

.contentbold {
font-size: 1.2em;
font-weight: bold;

h1,.componentheading, h1.componentheading {

h2,.contentheading, h1.contentheading {

h1#inlinetexth1 {
display: inline!important;

h3 {

h4 {

h5 {

h6 {

[edited by: SuzyUK at 6:54 pm (utc) on Feb. 13, 2008]
[edit reason] examplified specifics [/edit]


 11:56 am on Feb 13, 2008 (gmt 0)

hi webharvest,

I wrapped some 'content' text out of your naughty 'unexamplified' source above and put it in quotes to find your site: Have you seen it in firefox? I see you are not using this <h#> idea (when I visited 5 mins ago) that makes it sound like black-hat-SEO.

I wonder what a text-browser like lynx would make of it? Text-reader's nightmare by looks too. swa66 makes a huge point about titles and his remark about SEO effect I concur completely.

Ps. Sorry to be so blunt, I think you will have preferred to know by about the time you've sorted it all out. ;)


 12:23 pm on Feb 13, 2008 (gmt 0)

Yeah, I removed the <h1> tag under the inlinetexth1 div because it was not picking up the right formatting in the css file.

I know everyone says that you should not use h1 tags in the middle of text but I have seen page ranks increase after doing it. At the end of the day the three sets of words that I want to be h1 are key elements to my site. Making them "strong" does nothing for my SEO performance.


 1:46 pm on Feb 13, 2008 (gmt 0)

I don't think you mean PR so much as SERPs, if you are doing it more than about three times per page, I wonder if Google SERPs have you as high up as the others? If I was writing an internet indexing crawler like Googlebot and I had a few years up my sleeve and lots of resources to throw at it and have bits written cleverer than mine, it would be written to find dodgy looking situations and red flag them, just like Google has and will continue to improve on.

Do please tell me if you are using it, more than twice even, on a page and Google search results (even regionally) have you you in the top 5 for the words occuring in any of them, tell me these results have been relatively steady for more than three months and when I get my jaw off the floor I will try it in a text-reader myself.

I expect it to sound all wrong in a text-reader and I wonder how much of it would get green squiggly lines under it if you put it in word and used word's functions for setting things as headings and formatting them - I think those sort of algorythms might have gone into Googlebot ages ago and he really is giving better grades to higher quality content these days.

<h1>example</h1> does give your page some small matter of authority over the word 'example', particularly if used in a proper 'title' situation, but there are inline text elements (more than one) that have been around for ages that make the SEs sit up and listen as much as <h#> does and the only clue I'll give you is that the absolute majority of wysiwyg editors won't write one of the best ones for you and won't 'dress' the others to suitable effect - you need to figure out which ones they are and 'switch to source view' to apply them correctly. Good luck.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved