Forum Moderators: open

Message Too Old, No Replies

H1/2/3 - eliminating the surrounding space

         

JudgeJeffries

6:01 pm on Apr 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I want to use the H tag but when I do it forces space around the text which I dont want.
I know its meant to be that way but I understand there is something I can do about it to make the text flow and not be obtrusive.
Anyone have the coding

kiwanji

6:08 pm on Apr 18, 2003 (gmt 0)

10+ Year Member



The H tag automatically forces the line to break when you close it. If this is not what you want then use the font tag instead.

<font size="#"> where the # is 1-7, 1 being the smallest. Standard text on a web page is in size 3 to give you an idea of the number system. When you use the font tag you can open and close it as many times as you want without the line breaking until you want it to.

pageoneresults

6:18 pm on Apr 18, 2003 (gmt 0)

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



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

or...

h1,h2,h3,h4,h5,h6{margin-top:0px;margin-bottom:0px;}

It all depends on what you are up to and whether or not you are familiar with css. I would not recommend using <font> tags in today's advancing web design environment, they are deprecated. Still used quite a bit, but still deprecated.

brotherhood of LAN

6:19 pm on Apr 18, 2003 (gmt 0)

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



<h1 style="margin:0px">stuff</h1>
<h2 style="margin:0px">stuff</h2>
<h3 style="margin:0px">stuff</h3>

That also gets rid of the unwanted space....

//added
Too slow for P1 :)

pageoneresults

6:28 pm on Apr 18, 2003 (gmt 0)

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



BOL is using the inline method of css. My example is for external css. You can use either, although most of us prefer to keep the css external if possible. The more code you can take off page, the less html bloat you need to deal with.

If I'm not mistaken, some older browsers may have a problem with inline css, particularly NN4.x which we don't talk about that much anymore, its a bad word anyway. Usage is currently at 2% or less globally.

g1smd

6:45 pm on Apr 18, 2003 (gmt 0)

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



The <hx> tags are for headings, not for keyword stuffing.

Use the code validator at [validator.w3.org...] to check your code. Tick the box for show document outline, and then scroll down to Outline in the results screen. If what is shown there is not a summary of your document then you are probably abusing the tags.

tedster

8:34 pm on Apr 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here's a distant early warning:

I was reading about XHTML 2.0 yesterday, and there are signs that the Hn tag scheme may be on the way out.

XHTML 2.0 does, however, lay the ground work for their [numbered headers] deprecation by adding section and [unnumbered] h elements.

The conceptual problem with h1-h6 headers has always been that they aren't container elements; they don't create a section, merely announce the change of section by some special rendering of the section's title. But document sections or segments are often explicitly construed as named or unnamed containers in other XML or SGML applications.

O'Reilly's XML.com article [xml.com]