473,395 Members | 1,869 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Adjusting font of H1

Hello,

I am trying to use a heading tag in my pages but want to control the
look via a style sheet. I am new at CSS but here's what I have so far:

<HTML><HEAD>
<STYLE TYPE="text/css">
H1 {font-family: Arial; font-size: 12pt; color: white; text-align:
center}
</STYLE>
</HEAD>
<BODY>
<TABLE borderColor=black cellSpacing=0 cellPadding=1 width="95%"
align=center border=2>
<TR><TD bgColor=#000f99><H1>Topic Title</H1></TD></TR>
<TR><TD>Content goes here...</TD></TR>
</TABLE>
</BODY>
</HTML>

Now my problem is the height of the first row in the table... See what
happens... the cell looks like it takes the height of a standard h1
tag. Any way that anyone sees to shrink the height of the first row to
the font specified in the CSS?

I feel like I'm missing something easy here...
Thanks,
Chris
Jul 20 '05 #1
6 8658
On 17 May 2004 23:14:34 -0700, Chris McGarry <mc*****@paccorp.com> wrote:
Hello,

I am trying to use a heading tag in my pages but want to control the
look via a style sheet. I am new at CSS but here's what I have so far: .... Now my problem is the height of the first row in the table... See what
happens... the cell looks like it takes the height of a standard h1
tag. Any way that anyone sees to shrink the height of the first row to
the font specified in the CSS?

I feel like I'm missing something easy here...


Only happens in IE. Add this to h1 style:

margin-bottom: 0;
Jul 20 '05 #2

Neal wrote:
On 17 May 2004 23:14:34 -0700, Chris McGarry <mc*****@paccorp.com> wrote:

Hello,

I am trying to use a heading tag in my pages but want to control the
look via a style sheet. I am new at CSS but here's what I have so far:


....
Now my problem is the height of the first row in the table... See what
happens... the cell looks like it takes the height of a standard h1
tag. Any way that anyone sees to shrink the height of the first row to
the font specified in the CSS?

I feel like I'm missing something easy here...

Only happens in IE. Add this to h1 style:

margin-bottom: 0;


And use em or percent for the font-size, for readability. Some IE
users may think the 12pt is to small and pt is for print.

--
/Arne

Jul 20 '05 #3
Arne <ar********@telia.com> wrote in message news:<Fk********************@newsc.telia.net>...
Neal wrote:
On 17 May 2004 23:14:34 -0700, Chris McGarry <mc*****@paccorp.com> wrote:

Hello,

I am trying to use a heading tag in my pages but want to control the
look via a style sheet. I am new at CSS but here's what I have so far:


....
Now my problem is the height of the first row in the table... See what
happens... the cell looks like it takes the height of a standard h1
tag. Any way that anyone sees to shrink the height of the first row to
the font specified in the CSS?

I feel like I'm missing something easy here...

Only happens in IE. Add this to h1 style:

margin-bottom: 0;


And use em or percent for the font-size, for readability. Some IE
users may think the 12pt is to small and pt is for print.


Nice! Thanks Neal and Arne that did the trick. One additional
question: Netscape 4 still behaves that way. I'm assuming
margin-bottom is not compatible with NS4. Is that the case? This is
not a deal killer because I think NS4 is dying but it would be nice to
have it look uniform.

Thanks,
Chris
Jul 20 '05 #4
Chris McGarry <mc*****@paccorp.com> wrote:
Nice! Thanks Neal and Arne that did the trick. One additional
question: Netscape 4 still behaves that way. I'm assuming
margin-bottom is not compatible with NS4. Is that the case?


When it first came out, NN 4's CSS support wasn't too bad. It was certainly
a huge improvement over MSIE 3's CSS support. But that was 7 years ago.

Just hide all your CSS from NN 4, and let it view your site as a
CSS-unaware browser would. See
http://w3development.de/css/hide_css_from_browsers/
--
Darin McGrew, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/

"Men build too many walls and not enough bridges." - Sir Isaac Newton
Jul 20 '05 #5
Darin McGrew <mc****@stanfordalumni.org> wrote in message news:<c8**********@blue.rahul.net>...
Chris McGarry <mc*****@paccorp.com> wrote:
Nice! Thanks Neal and Arne that did the trick. One additional
question: Netscape 4 still behaves that way. I'm assuming
margin-bottom is not compatible with NS4. Is that the case?


When it first came out, NN 4's CSS support wasn't too bad. It was certainly
a huge improvement over MSIE 3's CSS support. But that was 7 years ago.

Just hide all your CSS from NN 4, and let it view your site as a
CSS-unaware browser would. See
http://w3development.de/css/hide_css_from_browsers/


Hi Darin,

Yeah I probably will just hide it like you say. Good idea and thanks!

Chris
Jul 20 '05 #6
mc*****@paccorp.com (Chris McGarry) wrote in message news:<b2**************************@posting.google. com>...
Hello,

I am trying to use a heading tag in my pages but want to control the
look via a style sheet. I am new at CSS but here's what I have so far:

<HTML><HEAD>
<STYLE TYPE="text/css">
H1 {font-family: Arial; font-size: 12pt; color: white; text-align:
center}
</STYLE>
</HEAD>
<BODY>
<TABLE borderColor=black cellSpacing=0 cellPadding=1 width="95%"
align=center border=2>
<TR><TD bgColor=#000f99><H1>Topic Title</H1></TD></TR>
<TR><TD>Content goes here...</TD></TR>
</TABLE>
</BODY>
</HTML>

Now my problem is the height of the first row in the table... See what
happens... the cell looks like it takes the height of a standard h1
tag. Any way that anyone sees to shrink the height of the first row to
the font specified in the CSS?

Not knocking on anything anyone else has said *and* somewhat off topic
but have you considered using the <th> tag for table headers?

:)

Lesley
Jul 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Joseph | last post by:
Letters appear too close together in sans serif default font when displayed in a JTextComponent. I see that there is a field called advance in one of the classes in java.awt.font, which is...
2
by: Ian | last post by:
In Windows XP, there's an accessability wizard that allows the user to change the font size for readability. There's probably something similar in other operating systems. I think it would be a...
8
by: slawek | last post by:
Hi i have following stylesheet: ..linklist { width: 100%; font-size: 75%; background: #EEEEEE; margin: 5px; height: 300px; overflow: auto;
1
by: dbo | last post by:
I'm looking to output text to a rich text box. The number of characters and lines will always be different. I need the output to fill the whole rich text box everytime. How can I do this? ...
3
by: Adam Smith | last post by:
Hello, How does one adjust the input field size (height) in a form, say to accept 10pt rather than the 12pt txt that apparently is the norm. Thanks --Adam--
14
by: mistral | last post by:
Below is Typewriter Scroller script. I want adjust is as follows: remove lower dash "_" out; display text not in form, but inside div, without any borders (style="visibility:hidden"). Also I need...
1
by: Oron.Morad | last post by:
Hello, I develop C#.NET (WinForm) over 2003server. I am looking for a way to adjust a component size (width pixels) according to a given text of a certain font (i.e font family, size and style)...
14
by: David C. Stone | last post by:
Is there a way in CSS to adjust the baseline position of text marked up with either <sup></supor <sub></sub>, relative to the surrounding text? Reason for asking is that the default rendering in...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.