I don’t want to reinvent the bikes.
|
2 answers
You can take a similar approach:
.wrapper { border: 1px solid black; display: table; } .wrapper div { display: table-cell; border: 1px solid blue; width: 50%; word-break: break-all; } <div class="wrapper"> <div contenteditable>Нажмите для редактирования</div> <div>Соседний блок</div> </div> <div class="wrapper"> <div>Ещё блок с каким-то содержимым.</div> <div>Другой соседний блок</div> </div> |
Use for this selector +
.class1 + .class2 { width: 100%; } - It is impossible to set both there and there one for width; I do not know him. The width of an element is determined by its contents. So the "+" is not the solution. - user208916
|
CSSdoes not have access to the applied parameters. Since the width is unknown and the one that is used is needed, onlyJSis easy there. - user207618