Converting absolute layout to use floats

后端 未结 7 2118
予麋鹿
予麋鹿 2021-02-01 05:23

I’m looking for some advice on a project I am working on and would be appreciative of any assistance.

Aim:

To make a drag and drop CMS which allows a user to d

7条回答
  •  孤城傲影
    2021-02-01 05:40

    The issue with converting from absolute positioning to floated is that you'll expend a lot of effort on something that probably won't translate well. Wouldn't it be better to have the elements use floating from the start?

    I know you don't want users to have to understand floating, but think about the way images work in Microsoft Word - the user drags the image to where they want it, and can then set how text wraps around it. This is not so different from floating elements, and will more accurately present the end result than something that has yet to go through a translation process that may or may not work 100%.

    Example:

    Drag an element onto the page, it takes up 100% width. Drag another element onto the page, it sits under the first and takes up the same. You then change the "wrap" style of both elements so they float left, and the page updates to show exactly what the user will get at the end. What you sacrifice in super flexible positioning, you make up for in a better user experience.

    Conclusion

    It sounds like you're anticipating your users needs by deciding that absolute positioning is the only solution flexible enough - my advice is: don't build features your users haven't asked for. Give them a drag and drop UI that you CAN build, and then if they ask for more features, figure it out then. They might never ask, and you'll save yourself a headache.

提交回复
热议问题