[opencms-dev] page content width
Frans Postma
fpostma at xs4all.nl
Thu Mar 31 21:44:34 CEST 2005
IF (big if) I were to do such a resize/width detection thing I would do it in javascript and modify a css-style.width from there.
You can use jsp stuff in a css file but that won't work to dynamically determine the width a client-window.
You would have to enclose the actual content-body in your template with a span/div of course (i.e. something like <span
id="mainbodystyle"></span> surrounding the include.element("bodytext") part). The javascript part would be inserted by the
template.
The width is usually *fixed* because making all elements dynamic (to the right at least) or floaty is rather hard in css to get
right. Css likes fixed positions ;-) (probably should duck for cover now)
There is something called the "X" library for javascript which figures out the width of a client-window for any browser I believe.
Looked into that briefly when I got annoyed at floating css :)
If you only want to have a fixed set of possible widths you can easily do that in the css file (by making it a jsp type file you
can sort of program it, templateone uses that technique)
Frans
> -----Original Message-----
> From: opencms-dev-bounces at opencms.org
> [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Erik Lyons
> Sent: donderdag 31 maart 2005 20:19
> To: opencms-dev at opencms.org
> Subject: [opencms-dev] page content width
>
> I've noticed in many sites that use OpenCMS, for example the
> Alkacon and
> Rueth documentation, the width of the main body is fixed and almost
> always wider than my window, causing horizontal scrolling. I find this
> rather amateurish and clumsy. What is the recommended way to
> avoid this
> with my templates? That is, at what code layer is it best to
> ensure that
> body content resizes with window width?
>
> -e.l.
>
>
>
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list,
> please visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev
>
More information about the opencms-dev
mailing list