Centering a percent-based div

前端 未结 6 1901
夕颜
夕颜 2020-12-13 18:23

Recently, a client asked that his site be percent-based rather than pixel-based. The percent was to be set to 80%. As you guys know, it is very easy to center the container

6条回答
  •  难免孤独
    2020-12-13 18:43

    I know it sounds crazy but how about getting the width in jQuery then resetting it so it is a pixel value?

    Or basing the width off the page width in jQuery?

    It's pretty weird he wants a percent based layout.

    Oh and last but not least, two 10% width divs surrounding it ;)

提交回复
热议问题