Forum Moderators: phranque

Message Too Old, No Replies

header troubles - please help

header troubles

         

amythepoet

4:19 pm on Aug 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi,

I'm still having trouble with my headers.

I thought that h1 was larger than h2 and so forth.

But when I look at it, h1 looks smaller than h2,

I don't know what the matter is. I don't see any funny codes in there, I don't think I did anything wrong.

Please help!

tbear

4:23 pm on Aug 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Do you have a link to a css style sheet on the pages? If so perhaps the sizes have been modified from there.

amythepoet

4:32 pm on Aug 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Oh tbear, yes that must be it,

I should look at my style sheet - thank you

amythepoet

4:36 pm on Aug 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi tbear,

I've looked at the style sheet and it says "

h1=18 px
h2=13px

Still though when I look at my test page, h1 appears smaller than h2

Amy

TheDoctor

9:42 am on Aug 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are you sure that one or the other of them is not being overridden with a "%" or "em" at a later stage in the style sheet?

grandpa

9:48 am on Aug 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Someone correct me if I'm wrong. I've looked at the style sheet, and believe the problem is here:

h1 { font-size:18px; font-family: verdana,arial,helvetica,sans-serif; font-weight:bold; color: #000000 };
h2 { font-size:12px; font-family: verdana,arial,helvetica,sans-serif; font-weight:normal; color: #000000 };

Both of these end with bracket, semi-colon, reversed from the ;} that I would expect to see.

amythepoet

5:30 pm on Aug 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks so much everybody, the header problem is fixed!

Now another thing, let's say that I would like to add a bold code to some of the headings, but not everyone , so I would want to do this righ to the specific page, such as lamps.html

If I had a header that said "Buy Fabulous Lamps Here"

and I wanted to make that bold

would I write the following:

<h1><b>Buy Fabulous Lamps Here</h1></b>

Thanks

pageoneresults

5:34 pm on Aug 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



<h>
tags by default are bold. There is no need to wrap an
<h>
tag in
<b>
tags.

Also, the tags above are nested incorrectly. It should be...

<h1><b>Heading Here</b></h1>

In your above example,

<h2>
font-weight is being overridden with the font-weight:normal. There is no need for the font-weight:bold in the
<h1>
.

amythepoet

6:14 pm on Aug 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ok, thank you

Amy

TheDoctor

12:04 am on Aug 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



First: how was the header problem fixed? Remember, there are people going to come along here in the future with header problems, and they'll get ideas of where to look based on how you fixed your problems.

Secondly: pageoneresults is correct about the HTML. But it's better still to control things like bold text through CSS.

amythepoet

12:24 am on Aug 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



HI Doctor,

The header problem was fixed in my style sheet, but I did not fix the bold problem in my style sheet, I guess I have to go do that.

That though I do not know how to do.

TheDoctor

12:38 am on Aug 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



To make h1 bold:

h1 { font-weight: bold; }

A really good investment is Eric Meyer's Cascading Style Sheets Programmer's Reference. When I first started to work with CSS, someone told me this was the only book I'd need. That's a bit over the top, but if I was only allowed one book on CSS this would be it. Keep it by your PC ;)

pageoneresults

1:33 am on Aug 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



To make h1 bold:
h1 { font-weight: bold; }

I have a question. If the default style of an

<h>
tag is bold, why would you need to specify
font-weight:bold;
in the CSS?

amythepoet

1:36 am on Aug 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks so much Doctor. I will look into getting that book

vkaryl

1:43 am on Aug 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ditto por. I've never yet added "bold" anything to an h1 tag.... h1 is bold by DEFAULT....

TheDoctor

8:39 am on Aug 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If the default style of an <h> tag is bold, why would you need to specify font-weight:bold; in the CSS?

You wouldn't - but this was the example that was being used, so I followed the flow.