Forum Moderators: open

Message Too Old, No Replies

<H1> Problems

Getting titles lined up...

         

subway

11:42 pm on Jun 19, 2003 (gmt 0)

10+ Year Member



Maybe someone can help.

For some reason, wherever I have h1 tags in my code e.g. the code below:

<td><h1 class="makeBigTextSmall">BLUE WIDGETS</h1></td>

...and then preview the page in IE - the text within the h1 tags appears right up at the top of the row. Is there something I've missed as I have never noticed this in any other browsers!

Thanks

DrDoc

11:56 pm on Jun 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



headings all have a bottom margin by default. Add this to your style sheet:

h1 {
display: inline;
}

or this:

h1 {
margin: 0;
}

Slade

11:57 pm on Jun 19, 2003 (gmt 0)

10+ Year Member



without seeing your style, and the output you're getting, it's hard to say for sure...

Did you zero out the margins and padding? (There is at least a margin by default, I think.)

grahamstewart

11:59 pm on Jun 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If this really is a table heading then consider using the <th> tag instead of <td>.

Also consider not (ab)using tables for layout :)

subway

11:59 pm on Jun 19, 2003 (gmt 0)

10+ Year Member



Thanks a lot guys!

subway

12:02 am on Jun 20, 2003 (gmt 0)

10+ Year Member



>>> Did you zero out the margins and padding?

Yeah, I just never noticed it before, I got into the habbit of previewing in opera 7 :o - as well as the whole h1 habbit!

Slade

3:59 am on Jun 20, 2003 (gmt 0)

10+ Year Member



There is nothing wrong with the header tags. Use them to the extent that they make sense. I don't mean every paragraph in it's own h6, just when you title a new section.

grahamstewart

4:12 am on Jun 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There is nothing wrong with the header tags

Well it depends on the context. There is nothing wrong with using them properly: as a header for a page, a section or a block of text - in fact it is positively encouraged.

But if you are creating a table (i.e. a REAL table not tables for layout) then you shouldn't use them as table headings - thats what the <th> tag is for.