Forum Moderators: open

Message Too Old, No Replies

Problem with H tag

How can I avoid the line feed of Hx tags

         

Digimon

9:56 pm on Sep 26, 2002 (gmt 0)

10+ Year Member



Hi all, I know that this is a little silly question but I'm using H tags for SEO and I've got problems with the line feed they automatic generate. I'm sure I read how to solve it in these forums but, after a while looking the old trheads I haven't been able to find it.

Thanks.

andreasfriedrich

10:05 pm on Sep 26, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



With CSS you can "convert" an block element to an inline element.

h1, h2, h3, h4, h5, h6 { 
display: inline;
}

Andreas

Nick_W

10:13 pm on Sep 26, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Good call, but I'd advise agoinst it.

Just re-adjust it's margins:

h1 {
margin-bottom: 0;
}

If you want it to be flush with a <p> then:

h1+p {
margin 0;
}

or it maybie p+h1, i can never remember...

Nick

Digimon

10:14 pm on Sep 26, 2002 (gmt 0)

10+ Year Member



Hello andreas, thank you! CSS design is not my best skill. I was sure it was easy...

PS: I love these forums, are like a irc channel (you leave your question and 5 minutes later somebody has answered you and right....)

Greetings!
(and good luck with the dance)

andreasfriedrich

10:40 pm on Sep 26, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Nick,

why would you advise against display:inline? As far as I know, and I donīt really know CSS, so I could very well be wrong, this is the only way to prevent a line feed.

Suppose we had the following html snippet:

<h1>Aaron</h1><p>Carter</p>

Without any CSS this would produce:

[6]Aaron[/6]

Carter

All one could achieve with your suggestions would be:

[6]Aaron[/6]
Carter

But if I understood the original poster right than this is not what was desired. Digimon wanted to produce something like this:

[6]Aaron[/6]Carter

The only way to get that would be:

h1, p { 
display: inline;
}

Another way would be to declare the h1 as a float:left.

h1, p { 
float:left;
}

But then Carter would be aligned with the top of the large A. This is probably a matter of what looks more appealing. When you have quite a lot of text it might look good to have it floating around your heading.

Andreas

Nick_W

10:47 pm on Sep 26, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just a judgement call....

<h1>'-6 should be used as headings, what need to put them inline?

Digimon

11:00 pm on Sep 26, 2002 (gmt 0)

10+ Year Member



Really I wanted to do both things so your information is really usefull.

Thanks both!

Nick_W

11:02 pm on Sep 26, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Up to you.

Think about how you page looks without a sheet? But also to low vision users?

Hick

andreasfriedrich

11:12 pm on Sep 26, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ok, so no technical objection but rather a matter of policy. :)

In printing you can find embedded headings (See LaTeX samples [math.jussieu.fr], Squeezing Space in LaTeX [www-h.eng.cam.ac.uk] the part about @startsection, Document Organization [english.ttu.edu] 5. Headings). That does not make them anything less than headings.

What need to put them inline?

To suggest a nicer and better looking styling for your page. Probably not suited for h[1-3] but ok for anything less. I like it. :)

Andreas

Hick
:)

How many pint did you have already? ;)

[edited by: andreasfriedrich at 11:14 pm (utc) on Sep. 26, 2002]

Digimon

11:14 pm on Sep 26, 2002 (gmt 0)

10+ Year Member



is that questions directed to me nick?

If it is I'll tell you that I want to use H tags for SEO porpouses so I need to put things together and under the keyword tagged with the Hx (pretty near and like if the H tag weren't there)

But I'm sure you know all these things...
;);)

tedster

4:30 am on Sep 27, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There's also a print technique called a "run-on" or "lead-in" header, where inline H tags can be used effectively. It looks just as you might expect - e.g.:

Marketing teams input produces cross purposing in view of goal alignments due to knowlege paucity, necessitating workflow education and orientation. Media sourcing as an acquistion strategy is counterproductive in a internet environment in virtual component methodology. Imaging through ideals rather than real world branding, is a perilous undertaking with negative results. Branding strategies generating motion as activity without reproducible results is a ultimately futile effort if left in place.

Nick_W

8:07 am on Sep 27, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How many pint did you have already?

Can't beleive I spelt my name wrong! Now I'm suffering the post update hangover...

Nick

Key_Master

1:08 pm on Sep 27, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hehe, got a good laugh from that Hick, errr Nick! :)

bryanmex

8:51 pm on Nov 9, 2002 (gmt 0)

10+ Year Member



What if you are wanting to use the HEADER tag just for optimization purposes, but want the text to show up as a defined text size and style type? I hardly ever use the Header because I don't want the big bold ugly text.