Looking at responsive web design - after the layout, I suddenly had some ideas. I would like to add that I don’t know if this can meet the requirements of this question, and there is no way to get the correct answer from the interviewer. When answering this question, I thought that the same problem would occur if the width was not set and if the height was not set (the parent container does not set the height, and the child container’s height set by percentage will not take effect). This is obviously wrong. A block-level element with no set width will occupy the full width of the parent container by default, so if you want to set the three columns to occupy 33% each, they can be of equal width: 1. Make the child elements arranged horizontally; 2. Make the child elements width Consistent;
Responsive Web Design - Layout
Looking at responsive web design - after the layout, I suddenly had some ideas. I would like to add that I don’t know if this can meet the requirements of this question, and there is no way to get the correct answer from the interviewer.
When answering this question, I thought that the same problem would occur if the width was not set and if the height was not set (the parent container does not set the height, and the child container’s height set by percentage will not take effect). This is obviously wrong. A block-level element with no set width will occupy the full width of the parent container by default, so if you want to set the three columns to occupy 33% each, they can be of equal width:
1. Make the child elements arranged horizontally;
2. Make the child elements width Consistent;
Option 1: (inline block method)
Option 2: (floating method)
Option 3: (Absolute positioning method)