I have a popup with two containers:
- text container
- container button
The pop-up window has a width of 370 pixels and buttons are displayed below the text.
The width of the popup can only be changed if the buttons have long text that causes the width of the popup to increase (the buttons should always appear on the same line).
If there is long text in the text container, the width of the pop-up should remain 370px.
For instance:
This is my jsbin:
http://jsbin.com/fuzozehipo/1/edit?html,css,output
HTML:
<div class="popup"> <div class="text-container">some text</div> <div class="buttons-container"> <button>Button 1 with long long long long long long text</button> <button>Button 2</button> </div> </div>
CSS
.popup { display: inline-block; position: relative; border: 1px solid; min-width: 370px; } .text-container { width: 100%; }
Any help appreciated!
source share