开发者

auto adjustable layout for all content

开发者 https://www.devze.com 2023-01-02 05:46 出处:网络
I need to dev a very flexible layout for a cms so that the structure auto-adjusts regarding 开发者_开发问答the content.

I need to dev a very flexible layout for a cms so that the structure auto-adjusts regarding 开发者_开发问答the content. The basic layout min-with layout is suposed to obey 1024px wide and it works fine for the most os the cases, but as we're talking about a cms, the editor very often creates content or copy/paste it from word and the content makes the layout stretch out so that i can look nice.

This is a huge challenge for me and i don't know you can i create a dynamic layout that behaves nicely regardless the content.

I only can think in jquery to help on this, and compute the content size and try to reset it to the appropriate size, but that doesn't look very easy or clean solution to do it.

So i'm posting this question to "hear" from you and have some cool suggestions an ideas that i can try out.

I'm sure most of you hava faced similar challenges.

Here's the layout i'm working on alt text http://img132.imageshack.us/img132/7661/0606y.png


A problem I've often had with layouts such as that is you want two columns to stretch to be the same size with dynamic content, but it doesn't always work. Here's a bit of Javascript that you might find useful in the future:

document.getElementById("sidebar").style.height = document.getElementById("content").offsetHeight + "px";

This assumes your height is in px (which it is 99% of the time), but it's useful for vertically stretching columns to match other columns.

0

精彩评论

暂无评论...
验证码 换一张
取 消