[TYPO3-templavoila] Using conditional comments in TV
Christopher
bedlamminusspamhotel at gmail.com
Tue Jun 6 18:12:03 CEST 2006
Jan Wulff wrote:
> Hi,
>
>>> If you're ignoring IE5 and don't use floats (guillotine bug, double
>>> float-margin bug, escaping floats bug, ...) it is possible to do modern
>>> layouts without hacks, but even then you have to live with line-height and
>>> list bugs. Of course you don't have to use conditional comments, but aren't
>>> they a lot better than the usual hacks?
>> I ignore ie5 but use floats all the time. There are several solutions to
>> common problems, they are well known and do not require hacjs or
>> conditional comments.
>
> I don't want to be impolite, but could you please give me an example for
> such a solution to the above-mentioned bugs without a hack? For all the
> three bugs you have to use either css-hacks or use elements in your html
> code, you wouldn't need in a standard-conform browser.
I guess Dimitry is talking about fixing the various 'haslayout' bugs in
IE using valid but theoretically irrelevant or incorrect css
declarations. For example, to fix IE's famous
'doubled-margin-on-floated-element' bug, you can add 'display:inline;'
to the floated element. This fixes the bug completely though it is
_technically_ incorrect since any floated element is considered by the
spec to have its 'display' property set to 'block' (it's also an
entirely harmless solution except for the tiny bit of stylesheet bloat
it adds).
Similarly, you should be able to fix the 'escaping-floats' bug like this
(untested, but ought to work...):
height:1% /* for IE only... */
min-height:200px !important; /* For others... */
There are various other fixes like these--including the
width/width+!important/min-width fix Dimitry mentioned--for IE bugs and
quite a lot of them /can/ be added directly to a stylesheet without
hacks and without requiring additional markup in the html document.
However, I prefer to use conditional comments because they make
stylesheet maintenance far simpler.
In any case, the workaround for your problem that works /now/ (and
which, I imagine you figured out a long time ago) is just to do all css
calls using TS.
-Christopher
More information about the TYPO3-project-templavoila
mailing list