Home > front end >  Just into the ways of new solutions
Just into the ways of new solutions

Time:12-27

Front end, please use percentage layout, margin - top percentage is calculated according to the width of the parent element, if the parent element width, height is changed, then the entire page is not loses shape, how can I solve this problem? For bosses to solve!

CodePudding user response:

Do you have any actual code example, besides general width with full height is mostly fixed
Margin - top percentage should be calculated according to height, if is the margin - left margin - right according to the width of the,,,

CodePudding user response:

I had a baidu the margin is indeed - top, and bottom percentage is calculated according to the width of the parent element, the height if hold can adaptively, how should I,

CodePudding user response:

Why do you want? Writing spacing?

CodePudding user response:


The
reference 3 floor ZionHH

[quote=reference 3 floor ZionHH response:
why do you want? Write a spacing
yes, I want to make a little space between the two div, but switch to some resolution case, margin - top values, but the window becomes so page deformation happens, don't know how to solve the

CodePudding user response:

Method 1: using flex layout;
Method 2: IE box model, and then do margin with padding

CodePudding user response:

Consider using overflow attributes
  • Related