[pmwiki-users] change rfloat/lfloat rules
Henrik Bechmann
henrik.bechmann at sympatico.ca
Sun Oct 1 15:30:56 CDT 2006
Patrick,
I added
$HTMLStylesFmt[] = "
.lfloat { float:left; margin-right:5px; }
.rfloat { float:right; margin-left:5px; } \n";
to (farm)config.php with the following result on the generated page:
<!--HTMLHeader--><style type='text/css'><!--
...
.lfloat { float:left; margin-right:5px; } /* my attempt at override */
.rfloat { float:right; margin-left:5px; }
.editconflict { color:green;
...
.frame
{ border:1px solid #cccccc; padding:4px; background-color:#f9f9f9; }
.lfloat { float:left; margin-right:.5em; } /* core rule comes later, and therefore given precedence */
.rfloat { float:right; margin-left:.5em; }
IOW the entry in $HTMLStylesFmt is not (necessarily) given precedence
over the native entry. Is there another way, using $HTMLStylesFmt, to
give my config.php entry precedence, or is entry in a cusom css file the
only way?
Re: an example for IE6:
The problem occurs in the context of my div-only page layout framework
which uses side-by-side floating divs for columns. Apparently IE6's
interpretation of .5em for almost-div-width lframes (or two side by side
lframes) is large enough that it causes a frame block to be formed which
is wider than the containing column (and not visually obvious). This
causes IE6 to "jump" the containing floating div -- the column -- to a
position underneath the adjacent column. A highly undesirable result.
This is mostly an IE6 anomaly, and one which is common to, and some
would say invited by, the div-only framework.
On a practical level, one could make an argument that a fixed left or
right margin is better for being predictable in all contexts. OTOH it
makes sense to tie the margin proportion to the surrounding font size(s).
Bottom line: I think this is an uncommon problem, as PmWiki uses a table
framework where the problem would not manifest. Therefore I would say
that the basis for changing the core to accommodate this anomaly is weak.
OTOH, it is an interesting case for the ability to over-ride core css
settings in a straightforward manner.
I would prefer to make the entry in config.php as it serves as a readily
visible reminder to the administrator of the change. However the core
css is generated first in web pages, so it's easy enough to override
core css by including overrides in any other css file that is included
in the template.
- Henrik
Patrick R. Michaud wrote:
> On Sat, Sep 30, 2006 at 10:16:05PM -0400, Henrik Bechmann wrote:
>
>> I want to change rfloat/lfloat rules from
>>
>> .lfloat { float:left; margin-right:.5em; }
>> .rfloat { float:right; margin-left:.5em; }
>>
>> to
>>
>> .lfloat { float:left; margin-right:5px; }
>> .rfloat { float:right; margin-left:5px; }
>>
>> What's the most concise/legitimate way to do this?
>>
>
> I'd do it in pub/css/local.css .
>
> It can also be done from config.php with:
>
> $HTMLStylesFmt[] = '
> .lfloat { float:left; margin-right:5px; }
> .rfloat { float:right; margin-left:5px; } ';
>
>
>> (the .5em is giving IE6 fits in certain contexts -- poor old thing!)
>>
>
> Ooh, could you give an example? Is it serious enough to warrant
> changing the core?
>
> Pm
>
>
--
Henrik Bechmann
www.osscommons.ca
www.bechmannsoftware.com
Webmaster, www.dufferinpark.ca
More information about the pmwiki-users
mailing list