Cenzic 232 Patent
Paid Advertising
sla.ckers.org is
ha.ckers sla.cking
Sla.ckers.org
For any nonsense or banter that doesn't fit anywhere else. LoL! omg! ROFL! 
Go to Topic: PreviousNext
Go to: Forum ListMessage ListNew TopicSearchLog In
Code 'malfunction' in Internet Explorer
Posted by: FlashO.-
Date: December 04, 2006 11:23AM

I was just playing about with some website development and I noticed than when I opened the site in Internet explorer the layout deforms in comparisson to FireFox.

I tried reading up about it but to no avail.


Why does this happen and how could I prevent it?



Thanks

Thanks::
Flash O.-

Options: ReplyQuote
Re: Code 'malfunction' in Internet Explorer
Posted by: rsnake
Date: December 04, 2006 11:44AM

Style sheets really do not act the same within IE and Firefox. That's actually one way to fingerprint the two browsers as a matter of fact. It could be one of a dozen or more issues that's causing it. We'd have to look at the HTML.

- RSnake
Gotta love it. http://ha.ckers.org

Options: ReplyQuote
Re: Code 'malfunction' in Internet Explorer
Posted by: maluc
Date: December 04, 2006 01:01PM

ya.. getting two pages made solely by CSS to look identical in both browsers is damn near impossible. i had to do it a while back for one site i built.. and i finally did, (and without any browser specific coding) but it was a major pain in the ass.

while i think it's generally a poor solution to have forked code.. you'll probably save yourself much of the headache by doing so with your CSS

and ya, as rsnake said.. there's a crapload of differences in their default values and the way they handle "zero" values and unsupported features. so can't say without seeing the page.

-maluc

Options: ReplyQuote
Re: Code 'malfunction' in Internet Explorer
Posted by: jungsonn
Date: December 04, 2006 04:07PM

Yes this might be true for many years, last year there's been alot of effort in the camps of the browser builders to go towards a "standard",(also due to the huge effort by W3C), so it's comming, slowly, but there is hope. it's a good idea that developers work together, like we see now with Mozilla & Adobe, Microsoft & Sun with Linux developers, it's a good thing. the more sharing the better. Everyone benefits.

Options: ReplyQuote
Re: Code 'malfunction' in Internet Explorer
Posted by: jungsonn
Date: December 04, 2006 04:08PM

@Flash O.-

can you post an example? i would like to see what happens.

Options: ReplyQuote
Re: Code 'malfunction' in Internet Explorer
Posted by: rsnake
Date: December 05, 2006 11:39AM

One major issue I found with a recent project I worked on was padding of a fixed width div. IE pads on the inside (so it will end up being exactly a fixed width. Firefox pads on the outside making the div your fixed width value + the width of the padding on both sides. I can see why Firefox might think that's a good idea, but really, if I give a fixed width, I mean fixed, I don't mean add some for good measure. It's also a browser fingerprint, it turns out.

- RSnake
Gotta love it. http://ha.ckers.org

Options: ReplyQuote
Re: Code 'malfunction' in Internet Explorer
Posted by: jungsonn
Date: December 05, 2006 12:02PM

MSIE is quite forgiving, but i don't what forgiveness.

With FF most of the time if it sucks in IE, the code is not right. FF is pretty strict. I like that alot, so most of the time when i build sites i build them for FF, (most of the time) it will work in IE also.

Them div's, yes but it's always a good idea to standard pad div's in your stylesheet in the beginning like: div { padding:3px; } better then to let the browser figure it out for you. it is cleaner to pad on the inside then on the outside.

MSIE has plenty more bugs, there are many css hacks to just make something function properly :)

Options: ReplyQuote
Re: Code 'malfunction' in Internet Explorer
Posted by: jungsonn
Date: December 05, 2006 12:04PM

And also: it depends on the DTD used.

how could i forget, this is really important.



Edited 1 time(s). Last edit at 12/05/2006 12:05PM by jungsonn.

Options: ReplyQuote
Re: Code 'malfunction' in Internet Explorer
Posted by: maluc
Date: December 05, 2006 04:24PM

ya.. firefox adding to the outside is probably the single most annoying thing i found about their differences. Opposite with the borders if i recall right (been a couple months) - firefox adds to the outside, and IE to the inside.

Honestly, both ways have valid arguments .. they just need to decide on one, add it to the RFC, and stick to it. Personally, i'd like to see borders on the outside, and padding on the inside.

I'd rather see these fixed before they fix the syntax bugs .. they're just too fundamental and make them unuseable cross-browser if they're different =.=

-maluc

Options: ReplyQuote
Re: Code 'malfunction' in Internet Explorer
Posted by: rsnake
Date: December 05, 2006 04:52PM

Agreed... I had to come up with some very cludgy hacks to get around that particular issue. I finally got it working only because I was willing to put up with vertical differences between the browsers. Horizontal was taken care of by having a div centered on top of a div that matched the padding of the top and the bottom. Ugleh.

- RSnake
Gotta love it. http://ha.ckers.org

Options: ReplyQuote
Re: Code 'malfunction' in Internet Explorer
Posted by: maluc
Date: December 05, 2006 05:59PM

i think i ended up using an outer shell div with a solid black background to act as the faux-borders.. then spaced all the divs leaving a 2pixel gap in between for the background color to show through - looking like a border.

quite a pain in the ass to resize anything though. on the bright side.. u can put in borders with intricate designs or gradients.

still, its sad to think i can't use built-in features and have to derive them from positioning =.=''

-maluc

Options: ReplyQuote
Re: Code 'malfunction' in Internet Explorer
Posted by: rsnake
Date: December 05, 2006 08:58PM

Exactly... I hate when people try to say that CSS is the best way to do formatting. It's just not. It's good for SEO due to size reduction, accessibility and consistancy though, and thus I use it because I must - not because it's good for formatting.

- RSnake
Gotta love it. http://ha.ckers.org

Options: ReplyQuote


Sorry, only registered users may post in this forum.