<h2> Tag....is this normal behaviour ?

Here is an example :

<table width=100% cellpadding=0 cellspacing=0 bordercolor=#003466 border=1>

After the word "test" there is a new line or carriage return or whatever caused by the </h2> tag(note that if you remove the </h2> tag it goes away).

Is this normal ?
How can I stop it ?

LVL 15
Who is Participating?
CJ_SConnect With a Mentor Commented:
but using the <font size=5> will give you different results on different settings of the browser.

Like messentary pointed out the carriage linefeed return will always be after a <Hx>.

To get the same result without the blank line you should instead use styles which have their height in pixels, and set it exactly like you want them. Then use those CSS styles within your own <font> tags...

Good luck,
ozymandiasAuthor Commented:
BTW, I am using IE 5.0, but it does the same in Netscape also.
Yes, this is normal.  Closing the h2 tag prevents the rest of the page from being displayed in the h2 font.
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

and being a header, it will do a carriage return.  If you don't want the carriage return, don't use the <h2> tag, and use a <font size=5> tag instead.
or use some css...

<H2 STYLE="margin-bottom:0px">test</H2>

should work...

btw: you could also define stylesheets in the <HEAD> tag...


.... title and meta stuff ...

h2 {

this will give all h2s in you document a uniform shape...

sorry cj s...
i was writing this stuff while you added this comment...
it's okay, great minds have the same thoughts =/
ozymandiasAuthor Commented:
Damn it...I had done this with a style sheet and it didn't work. Problem was I had missed the semicolon off the style line above the margin-bottom setting and I didn't notice <kicks self v.hard>.

    COLOR: #003466;
    FONT-FAMILY: Verdana,Arial,Helvetica;
    FONT-SIZE: 12px;
    TEXT-DECORATION: none <==missing semicolon !

I guess CJ_S gets the points.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.