The design drawing stipulates that the length of the left block is 218px
, but I have no way to determine the length of the next block in the same line. I hope that the last block can automatically fill the current line. Please advise
The current css
style of the first block is:
float: left;
width: 218px;
Rendering:
flex you deserve but remember to add the prefix
The block on the left can be positioned: absolute; absolutely positioned. The block on the right is directly margin-left: 218px; and then display:block;
1. Parent
{display:flex;}, right {flex:1}
2. Right
{float:left;width:calc(100% - 218px);}
Last piece{
}
The percentage is okay
flex is a solution, but many times it is now required to be compatible with low-end browsers such as IE8, and flex is not possible.
Provide another solution:
Structure:
Style: