css margins not working

G

Guest

Yet another question as I get deeper into this CSS mystery.
I'm applying an h2 tag to several lines on my page. I want a small margin
below each of these lines. In the CSS, it looks like this:

h2 { font-family:Arial, Helvetica; font-weight:bold;
font-size:10pt; margin-bottom: 6; }

But when I apply Heading 2 to a line, there's no space beneath it. When I
look at the html, it looks like this:

<h2 style="margin-bottom: 0">Maryland Sea Grant</h2>

Where is that zero margin indicator coming from? I can change the code so it
reads <h2>Maryland Sea Grant</h2>, and that displays correctly, but there's
got to be a better way.
Thanks again for the help.
kelly
 
S

Steve Easton

Remember the "Remove Formatting" trick??


--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
M

Murray

ALL style values must have units (except for zero, which is really nothing
no matter what units!), ergo -

margin-bottom: 6px; }
..
 
G

Guest

I understand what you mean about the units, but here's the weird thing: the
Heading 2 style works in some places and not in others. When it works, and
there is space below the text, the html code of the page looks as it should:

<h2>author name</h2>

But when it doesn't work, and there's no space, the html looks like this:

<h2 style="margin-bottom: 0">author name</h2>

If I edit style=margin-bottom:0" out of the code, then it works. What
I don't understand is why applying a style changes the html of the page the
way it's doing. Shouldn't it just plug in <h2> and </h2>? Where's the rest
of that code coming from?
kelly
 
M

Murray

I understand what you mean about the units, but here's the weird thing: the
Heading 2 style works in some places and not in others.

Without units, *it* cannot work. It's possible that you are seeing space
there for some other reason, but a style of margin:6; is unworkable.

<h2 style="margin-bottom: 0">author name</h2>

A value of zero is always workable. This markup explicitly sets the bottom
then it works.

It cannot - but humor me by showing me the page and I'll tell you why you
*think* it's working. 8)
Where's the rest
of that code coming from?

Something you are doing. I don't know what it is you are doing, so I can't
take it any further than that....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top