[pmwiki-users] height problem remains :( (it was Re: Problem with height when resizing images)
Ben Stallings
ben at interdependentweb.com
Mon Mar 19 09:18:48 CDT 2007
Sergio wrote,
> I fixed the typo, writing:
>
> %height=20pct% http://www.openkairos.com/wiki/imgs/primera.jpg"Escritorio de
> Mandriva"
>
> %width=20pct% http://www.openkairos.com/wiki/imgs/primera.jpg"Escritorio de
> Mandriva"
>
> The second example works fine, but not the second one. I don't figure it out
> why :(
I hate to be the one to tell you, Sergio, but percentage heights don't
work consistently from one browser to another... it's an inconsistency
in HTML and CSS, not in PmWiki. So even if the HTML being produced by
the wiki is correct (which you haven't said one way or the other), you
will still get inconsistent rendering whenever you specify height as a
percentage.
Consider: 20% of what? Of the window? Of the containing element, which
may be a table cell or a div? Or of the page as a whole? Width=20%
means width of the containing element, which is confusing enough when
you're working with divs that do not contain each other -- a div of 80%
width will stick off the edge of the page if it's being displaced by a
div of 30% width. But height? A page is almost always either shorter
or longer (taller) than the window, and rarely does any one element on
the page extend the whole height of the page.
That being said, I have on occasion been able to achieve some good
results with percentage heights by putting the images inside table
cells, and having the height of the row be defined by the contents of
neighboring cells in that row (for example, the text of the page).
Example:
(:cellnr:)
%height=20pct%http://www.openkairos.com/wiki/imgs/primera.jpg"Escritorio
de Mandriva"
(:cell:)
Aqui esta el escritorio\\
de Mandriva Linux\\
que parece tan facil\\
usar como Windows XP\\
o Mac OS X.
(:tableend:)
This should, theoretically, produce an image that is 20% the height of
the text beside it. So good luck! --Ben
More information about the pmwiki-users
mailing list