?
Solved

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

Posted on 2000-05-18
8
Medium Priority
?
286 Views
Last Modified: 2010-04-09
Here is an example :

<html>
<head>
</head>
<body>
<table width=100% cellpadding=0 cellspacing=0 bordercolor=#003466 border=1>
<tr>
<td>
<h2>Test</h2>
</td>
</tr>
</table>
</body>
</html>

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 ?



0
Comment
Question by:ozymandias
  • 2
  • 2
  • 2
  • +1
8 Comments
 
LVL 15

Author Comment

by:ozymandias
ID: 2820941
BTW, I am using IE 5.0, but it does the same in Netscape also.
0
 
LVL 3

Expert Comment

by:messentary
ID: 2820956
Yes, this is normal.  Closing the h2 tag prevents the rest of the page from being displayed in the h2 font.
0
 
LVL 3

Expert Comment

by:messentary
ID: 2820957
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.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 22

Accepted Solution

by:
CJ_S earned 200 total points
ID: 2821034
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,
CJ
0
 

Expert Comment

by:webhornet
ID: 2821061
or use some css...

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

should work...

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

<HEAD>

.... title and meta stuff ...

<STYLE>
<!--
h2 {
margin-bottom:0px
}
//-->
</STYLE>
</HEAD>
<BODY>
....

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

webhornet
0
 

Expert Comment

by:webhornet
ID: 2821066
sorry cj s...
i was writing this stuff while you added this comment...
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 2821094
it's okay, great minds have the same thoughts =/
0
 
LVL 15

Author Comment

by:ozymandias
ID: 2821319
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>.

H2
{
    COLOR: #003466;
    FONT-FAMILY: Verdana,Arial,Helvetica;
    FONT-SIZE: 12px;
    TEXT-DECORATION: none <==missing semicolon !
    MARGIN-BOTTOM:0px;
}

I guess CJ_S gets the points.
0

Featured Post

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question