/    Sign up×
Community /Pin to ProfileBookmark

firfox vs ie???

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???

[upl-file uuid=82828431-66f7-4816-b1e9-3c4afc2edd31 size=7kB]test.txt[/upl-file]

to post a comment
HTML

15 Comments(s)

Copy linkTweet thisAlerts:
@NogDogDec 01.2006 — 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:
<i>
</i>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"&gt;

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

Then run your file through the [url=http://validator.w3.org/]HTML Validator[/url] and start addressing the problems it indicates.

Once the HTML is solid, run the page through the [url=http://jigsaw.w3.org/css-validator/]CSS Validator[/url].

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.
Copy linkTweet thisAlerts:
@abzDec 01.2006 — very often it will be IE that goes wrong, not you http://www.howtocreate.co.uk/wrongWithIE/

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: http://www.hotdesign.com/seybold/

You are also using font tags which is a neolithic way of adding styles to your page: http://www.mcsr.olemiss.edu/~mudws/font.html

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.
Copy linkTweet thisAlerts:
@tanneyman13authorDec 01.2006 — 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.

[upl-file uuid=57b0750a-ec61-4066-81a5-5b7e04e231e4 size=6kB]test.txt[/upl-file]
Copy linkTweet thisAlerts:
@abzDec 01.2006 — 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.
Copy linkTweet thisAlerts:
@abzDec 01.2006 — 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 with
Copy linkTweet thisAlerts:
@tanneyman13authorDec 01.2006 — so :px is what i should add to the height attribute? to denote pixels
Copy linkTweet thisAlerts:
@abzDec 01.2006 — it 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 pixels
Copy linkTweet thisAlerts:
@tanneyman13authorDec 01.2006 — didnt mean to put a smily face there i meant : px
Copy linkTweet thisAlerts:
@ray326Dec 01.2006 — You 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.
Copy linkTweet thisAlerts:
@tanneyman13authorDec 01.2006 — 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.
Copy linkTweet thisAlerts:
@KorDec 01.2006 — 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.[/QUOTE]

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.
Copy linkTweet thisAlerts:
@FangDec 01.2006 — 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 with[/QUOTE]A length value without units defaults to pixels: http://www.w3.org/TR/html4/types.html#h-6.6
Copy linkTweet thisAlerts:
@KorDec 01.2006 — A length value without units defaults to pixels: http://www.w3.org/TR/html4/types.html#h-6.6[/QUOTE]

maybe [B]abz[/B] 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.

[COLOR=Blue]<img src="pic.jpg" height="20" width="50" alt="">[/COLOR]

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

[COLOR=Blue]obj.style.height='20px';[/COLOR]

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

[COLOR=Blue]obj.style.margin='0';[/COLOR]
Copy linkTweet thisAlerts:
@abzDec 01.2006 — 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 ?

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 preference
Copy linkTweet thisAlerts:
@KorDec 01.2006 — 
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 preference[/QUOTE]


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=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="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="mypic.jpg" alt="" onclick="alert("Hello!")" />
×

Success!

Help @tanneyman13 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...