By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,739 Members | 1,081 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,739 IT Pros & Developers. It's quick & easy.

newbie problems alignment in tables

P: 5
Hi folks, I'm new to CSS and kind of lazy when it comes to coding, but I've tried to do this page by the book and it has a weird problem.

I've created a table with a particular background (specified by CSS) for certain cells. It looks great but when I put an IMG html in that cell, the background for that cell escapes the borders and is all out of alignment. The contents of the cell always seem to move to the top and the middle of the page. I'm checking everything works in IE6 and Firefox but this problem only occurs in IE6...

you can view the page at

the stylesheet is

If anyone can figure out what causes this I'd very grateful! Maybe I need to set some alignment attributes for IMG....

Mar 4 '07 #1
Share this Question
Share on Google+
7 Replies

Expert 5K+
P: 7,435
First, you will never get IE6 to pretend it's a modern browser without a proper doctype. See the sticky at the top of this board. Use html4 strict.

Then validate your html and css for any errors reported there.

As a final note, you need to get in the habit of using lower case in your markup. HTML doesn't care but CSS and, later, xhtml does.
Mar 4 '07 #2

P: 5
ok thanks for those pointers, I'll look into those issues
Mar 5 '07 #3

P: 5
I looked into the doctype thing and it made things look slightly different but didn't solve the weird alignment problem. Does anyone have any other pointers?
Mar 5 '07 #4

Expert 5K+
P: 7,435
Of course, things changed. You didn't specify which set of rules you were using. By using a doctype, the rules were changed from 'quirks' (ala 1998) to modern standards. But you must establish the rules so all browsers are on the same 'page' before you can fix things.

The validator can't properly interpret part of your page so browsers will have trouble, too. Perhaps you are saving your text in utf8 or something else? Look into that but add this to the head of your code:
<meta http-equiv="content-type" content="text/html;charset=utf-8">

This establishes the character set. Then revalidate for your list of errors.

Again, all this may not solve the initial problem but we need to get on the right foundation.
Mar 5 '07 #5

P: 5
ok thanks, I fixed the doctype and charset. I checked for errors and fixed all those I could. It gave me a few that I just don't understand like the HEAD tag being left unfinished

any more ideas are greatly appreciated
Mar 5 '07 #6

Expert 5K+
P: 7,435
You need to thoroughly read the error information. For the <head> error, it says it is incomplete. In this case, it's looking for the <title> tags inside the head. Look around and also close up the open ending tags.
Mar 5 '07 #7

P: 5
ok all errors fixed! - in the html at least
Mar 5 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.