firfox vs ie???

liunx

Guest
I'm in the process of creating a really simple webpage for a class and the whole time I have been viewing it in firefox and I just went to view it in IE version 7 and my table cells sizes are completly different. I have no idea where I went wrong???The first problem to address is the lack of a doctype declaration. You probably want to use HTML 4.01 Transitional since you are using a lot of deprecated attributes in your mark-up:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

This should be the very first line of your file, before the <html> tag.

Then run your file through the HTML Validator (<!-- m --><a class="postlink" href="http://validator.w3.org/">http://validator.w3.org/</a><!-- m -->) and start addressing the problems it indicates.

Once the HTML is solid, run the page through the CSS Validator (<!-- m --><a class="postlink" href="http://jigsaw.w3.org/css-validator/">http://jigsaw.w3.org/css-validator/</a><!-- m -->).

At that point, if the browsers are still acting differently, then we'll have to look at the specifics and see if there is a work-around for you.very often it will be IE that goes wrong, not you <!-- m --><a class="postlink" href="http://www.howtocreate.co.uk/wrongWithIE/">http://www.howtocreate.co.uk/wrongWithIE/</a><!-- m -->

However there are some *fatal* errors in your markup. First off, you have no <!DOCTYPE which means you page will never render how you intend

Next you are using squillions of tables, when you dont need any at all. Tables are not for making layouts, they are for displaying tabular data: <!-- m --><a class="postlink" href="http://www.hotdesign.com/seybold/">http://www.hotdesign.com/seybold/</a><!-- m -->

You are also using font tags which is a neolithic way of adding styles to your page: <!-- m --><a class="postlink" href="http://www.mcsr.olemiss.edu/~mudws/font.html">http://www.mcsr.olemiss.edu/~mudws/font.html</a><!-- m -->

So yes, unfortunately the outlook is not good.
I strongly suggest you read up on using divs and css for styling, and remembering that HTML is a MARKUP LANGUAGE not a make things look different language. HTML shoudl only be describing the structure of yout content, it should look like a word document on its own. Only when you add css shoudl it begin to take shape visually.

if you are still learning, there is absolutely *no* point in learning it wrong. my advice is to start again, and do it right, to save you the hassle later in life.thank you all for your help, I know my code is not up to standards at all and it is just really basic and ancient. i'm not a career web developer or anything but the few courses i took long ago preached tabular formating and the tutorials that i refered to did as well so that is why i did it. does ie just handle tables differently than firefox?? is there any easy work around for this other than using css and divs? is there a parameter that i am setting throughout my tables that firefox specifically handles differently than ie? i did run my file through the validators and i will reattach it in case someone would be so gracious as to give me some more pointers. thanks.the first link in my reply above has a fairly detailed list of things that IE does wrong. Might help you to scan through those and check if there is anything you notice.ok, I notice you arent using any units on yrou height specifications. This could be confusing everything. Telling a browser to make something '20' high, will mean nothing. you have to put in the unit so it knows what it is dealing withso :px is what i should add to the height attribute? to denote pixelsit depends if you want it to be Xpixels high or Xelephants high. Use the unit you want it to be. Yes, px is the notation for pixelsdidnt mean to put a smily face there i meant : pxYou say you're creating this page "for a class". Please don't teach yet another room full of blank slates last century's concepts. We've got enough crippled web builders out there as it is.I'm not teaching anyone...I'm submitting this page as a project for a class. The sad part is that I am a web app programmer that really needs to brush up on his html. Ive been using asp.net and C# and the application that I have been maintaining uses a combination of html tables and asp tables as its basis of formating so it just came second nature to do it here.I'm not teaching anyone...I'm submitting this page as a project for a class. The sad part is that I am a web app programmer that really needs to brush up on his html. Ive been using asp.net and C# and the application that I have been maintaining uses a combination of html tables and asp tables as its basis of formating so it just came second nature to do it here.

Don't under estimate the client-side languages' evolution. For different reasons, HTML, CSS and javascript have changed dramatically in the last years, compared with the server-side languages. And the trend remains the same, as far as I can see.ok, I notice you arent using any units on yrou height specifications. This could be confusing everything. Telling a browser to make something '20' high, will mean nothing. you have to put in the unit so it knows what it is dealing withA length value without units defaults to pixels: <!-- m --><a class="postlink" href="http://www.w3.org/TR/html4/types.html#h-6.6A">http://www.w3.org/TR/html4/types.html#h-6.6A</a><!-- m --> length value without units defaults to pixels: <!-- m --><a class="postlink" href="http://www.w3.org/TR/html4/types.html#h-6.6">http://www.w3.org/TR/html4/types.html#h-6.6</a><!-- m -->

maybe abz confounds HTML attributes with CSS attributes. HTML attributes by default are measured in pixels, so that there is no need to soecify the measurement units, if you intend to use pixels.

<img src=http://www.webdeveloper.com/forum/archive/index.php/"pic.jpg" height="20" width="50" alt="">

CSS (and "on-the-fly" techniques) need by all means (even IE is tolerant in this case, but it is in mistake) the measurement units to be specified

obj.style.height='20px';

But even in CSS there is an exception, the 0 value (which, of course, means 0, no matter the unit)

obj.style.margin='0';ok, my bad on the px thing. I would still always put in in though. help stop confusion when inexperienced people like me look at your code and dont understand :P

and yes, of course 0 is always 0 wether its elephants, pigs or pixels. Im sure there are some exceptions to that in weirdy languages, but meh.

Looking back at your code, I would also add the " " aroudn all your values. again it might be something that isn't needed, but it is good practise in my mind. if you do it every time, then you get in the habit, and are less likely to forget to close one, and then screw up everything. But i guess that is down to personal preferenceLooking back at your code, I would also add the " " aroudn all your values. again it might be something that isn't needed, but it is good practise in my mind. if you do it every time, then you get in the habit, and are less likely to forget to close one, and then screw up everything. But i guess that is down to personal preference

It depends on what code. If you mean HTML, yes, you are quite right. But to have a clear picture, note that it depends on the Doctype. HTML (especialy under quirqsmode or under a HTML transitional Doctype) needs no double quotes for attributes by all means (it needs no quotes att all, if you want), but still needs double quotes for event handlers.

<img SRC=http://www.webdeveloper.com/forum/archive/index.php/mypic.jpg onClick="alert('Hello!')">

But under a XHTML Doctype, the code is strict. All the tags, attributes and events must be lowercase, and their values must be quoted (usually double quoted - in order to use single quotes for other aims).

<img src=http://www.webdeveloper.com/forum/archive/index.php/"mypic.jpg" alt="" onclick="alert('Hello!')" />

So that:
1. Yes, you are right, it is a good habbit to use always double (or single - but to keep a common rule, double is an unwritten rule) quotes for the attributes' values, and lowercase for tags, attributes and events, but:
2. No, you are wrong, it is not down to personal prefrences, it is up to the Doctype you use

If you mean javascript, yes, it does not matter which kind of quotes you use. You have only to take care to use inside a quoted string the other quotes or to escape them, if you need a literal quote.

<img src=http://www.webdeveloper.com/forum/archive/index.php/"mypic.jpg" alt="" onclick="alert(\"Hello!\")" />
 
Back
Top