5 replies [Last post]
Stewart
Offline
Regular
Dundee, Scotland.
Last seen: 15 years 48 weeks ago
Dundee, Scotland.
Joined: 2003-11-16
Posts: 16
Points: 0

Hi Everyone.

How on earth do you close the gap between a Heading and a Sub-Heading which use 2 different font sizes. To get this for example:

Quote:
Heading
Sub-Heading

Instead of this:
Quote:
Heading

Sub-Heading Here's my code for each heading.

Quote:

h2 {
color: #8E0090;
font-weight: bold;
font-size: 20px;
text-align: center;
font-family: tahoma, verdana, sans-serif;
}

h6 { color: #8E0090;
font-weight: normal;
font-size: 13px;
text-align: center;
font-family: tahoma, verdana, sans-serif;
margin: 0px;
padding: 0px;
height: 10px;
}

Can anyone please suggest anything that will work for both Mozilla and IE6?

Regards.

Stewart.

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 2 days 17 sec ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5342
Points: 2963

Closing the gap...

Hi Stewart,
Add margin:0; to the H2 as well as the H6.

Hope that helps

Stewart
Offline
Regular
Dundee, Scotland.
Last seen: 15 years 48 weeks ago
Dundee, Scotland.
Joined: 2003-11-16
Posts: 16
Points: 0

Aha

Hi Tony.

Thanks for that. I can't help feeling a bit daft for not figuring it out myself. I'm convinced I already tried that (probably not though :oops: )

Thanks again.

Stewart.

JohnO
Offline
Regular
Rochester NY
Last seen: 15 years 43 weeks ago
Rochester NY
Timezone: GMT-5
Joined: 2003-12-18
Posts: 16
Points: 0

Closing the gap...

there is also a line-height attribute as well

goto www.devguru.com and click on CSS2, and view index to see all available (standard) attributes

dJomp
dJomp's picture
Offline
Enthusiast
Last seen: 3 years 37 weeks ago
Joined: 2003-03-23
Posts: 422
Points: 0

Closing the gap...

But in this case the line-height will have no effect.

If you don't want to remove all the margins, don't forget you just need to set margin-bottom of the top H, and margin-top of the bottom H to 0.

You know you're a geek when you try to shoo a fly away from the monitor with your cursor.

Stewart
Offline
Regular
Dundee, Scotland.
Last seen: 15 years 48 weeks ago
Dundee, Scotland.
Joined: 2003-11-16
Posts: 16
Points: 0

Thanks

Hi again.

Thanks for your answers folks. Much appreciated.

Stewart.