There is a block with a plate on top of it, like this:
.foo { font-family: Arial, sans-serif; font-size: 16px; width: 170px; height: 100px; background-color: #eef; border: 1px solid #77f; text-align: center; } .plashka { display: inline-block; background-color: #aaf; } <div class="foo"> <div class="plashka"> Здесь нужно что-то длинное </div> </div> The plate stretches to the full length of the parent block, and I want it like this - so that the plate has no internal indent either on the left or on the right:
.foo { font-family: Arial, sans-serif; font-size: 16px; width: 170px; height: 100px; background-color: #eef; border: 1px solid #77f; text-align: center; } .plashka { display: inline-block; background-color: #aaf; } <div class="foo"> <div class="plashka"> Здесь нужно что-то<br/>длинное </div> </div> Is this possible without explicitly spelled out <br/> and without any restrictions on width? So that everything adapts itself to the text.
UPD: another example for clarity:
.foo { font-family: Arial, sans-serif; font-size: 16px; width: 170px; background-color: #eef; border: 1px solid #77f; text-align: center; } .plashka { display: inline-block; background-color: #aaf; } <div class="foo"> Как не надо: <div class="plashka"> а б в г д е ё еёжзийклмно </div> Как надо: <div class="plashka"> а б в г д е ё<br/>еёжзийклмно </div> <hr/> Как не надо: <div class="plashka"> а б в гдеё ж з и к л мнопрстуфх </div> Как надо: <div class="plashka"> а б в гдеё ж з и к л<br/>мнопрстуфх </div> </div>
paddingparent can not be added? - teran