javascript - There are three boxes in a row. The distance between each box is 15px, and the distance from the white box outside is also 15px. How to write this css?
Setting decimals will not take effect. Some browsers will round off, and some will round directly. The answer above is correct. You need to set the last small box separately
}, Padding of the large frame: 15px; The width of the small frame is (large frame width-60px)/3. This ensures three small frames in each row, and the layout is also fixed. The small frame float:left;margin- bottom: 15px;
It seems that flex can also be implemented
Small frame: {
}
Large frame: {
}
大框padding:15px;小框margin-right:15px;margin-bottom:15px;小框nth-child(3n)的margin-right:0;last-child,nth-last-child(2),nth-last-child(3)的margin-bottom:0;
Setting decimals will not take effect. Some browsers will round off, and some will round directly. The answer above is correct. You need to set the last small box separately
flex layout is easy to implement
nth-child(3n){
},
Padding of the large frame: 15px;
The width of the small frame is (large frame width-60px)/3. This ensures three small frames in each row, and the layout is also fixed. The small frame float:left;margin- bottom: 15px;
<p>
</p>
p Set inner margin padding
dl Set float: left;
dt,dd Set float: left;
The rest is to define the width, height and inner and outer margins of the box
I am a newbie, please correct me if I am wrong
This method is compatible with ie6