Forum Moderators: not2easy

Message Too Old, No Replies

Cross-Browser layout without hacks.

Is is possible?

         

yowza

9:31 pm on Jan 3, 2004 (gmt 0)

10+ Year Member



It appears to be impossible to make a cross-browser compatible full-css layout without using hacks.

Is that the case?

Sorry for asking what may be a stupid question.
However, I am building a tableless site for the first time.

Longhaired Genius

9:45 pm on Jan 3, 2004 (gmt 0)

10+ Year Member



The simpler the layout the fewer the hacks. But, yes, in practice it is impossible to make a cross-browser compatible full-css layout without using hacks.

yowza

9:57 pm on Jan 3, 2004 (gmt 0)

10+ Year Member



Ok.That's what I concluded after about three days of trying without hacks.

Related question:

Could someone please tell me if the following is right?

/*/*/
*float: left;
/* */

I'm trying to target only IE with the float. But I read that I have to shield it from NN4 with the comment tags.

DrDoc

10:01 pm on Jan 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you want to (or need to) target only IE it is much better to use conditional comments. That way you don't have to worry about whether a hack will trigger a bug in some random browser.

RammsteinNicCage

6:17 am on Jan 4, 2004 (gmt 0)

10+ Year Member



I have two full css sites and don't employ any hacks, at least not conciously. What would actually be considered a hack? I know there's the thing with the box model and voice-family or something, but never had to use that and I have no problem cross-browser that I can detect.

Jennifer

Rincewind

9:37 am on Jan 4, 2004 (gmt 0)

10+ Year Member



It's perfectly possible to make x-browser css designs without hacks. However it does depend on what you mean by x-browser. If you want every element and letter accurate to the pixel then no, can't do it and probably never will be able to do it. every browser has it's own character. But so make a design that looks good in as many browsers as posible and doesn't break (cease to function). Well thats actually quite easy.

The mistake allot of people make it to try an create css based designs that look like tabled desgins. Once you realise that you can be more creative with your layout, all the bugs become a sideshow. As long as you understand the limitations of css and know the bugs, you can avoid problems before they occur thus cutting out the need for hacks. The biggest gain is cutting out the most common hack of all; The hack of using tables for page layout.

Longhaired Genius

10:54 am on Jan 4, 2004 (gmt 0)

10+ Year Member



Hiding css from Netscape Navigator 4 with @import is a hack.

TheDoctor

10:56 pm on Jan 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hiding css from Netscape Navigator 4 with @import is a hack.

This may be a question of words, but I don't think it is. One of the principles used, from the beginning, in the design of the web was the notion that, if a browser finds something it doesn't understand, it would ignore it. The idea behind this was to make the web upgradeable.

So, therefore, hiding something from an old browser by putting it within a new construction is perfectly legit, and was something that was anticipated from the start.

It isn't that NN4 handles @import incorrectly. It's that it doesn't understand it, so doesn't try to b*gger about with it. In this respect, NN4 is well-behaved.

Longhaired Genius

11:37 pm on Jan 4, 2004 (gmt 0)

10+ Year Member



I think it's a hack in this context because the only reason you have to hide the css fron netscape 4 is because it will mess it up completely, not ignore what it doesn't understand. But I'm happy to agree to differ.