There is this form
.b-input-field { position: relative; text-align: left; width: 200px; } .b-input-field__help-block { display: none; color: white; max-width: 310px; position: absolute; background: #F6744B; opacity: 0.85; z-index: 3; border-radius: 3px; padding: 20px 16px; left: 50%; transform: translate(-50%, 12px); } .b-input-field__help-block:before { display: block; content: ''; position: absolute; top: 0; left: 50%; transform: translate(-50%, -8px); z-index: 10; border-color: transparent transparent rgba(246, 116, 75, 1) transparent; border-style: solid; border-width: 0 8px 8px 8px; width: 0; height: 0; } .b-input-field:hover .b-input-field__help-block { display: block; } <div class="b-input-field"> <div> <label class="b-input-field__label">Label</label> <div class="b-input-field__input-wrap"> <input type="text" class="b-input-field__input " autocomplete="off" name="name" value=""> </div> <p class="b-input-field__help-block">ΠΠ°ΠΊΠΎΠΉ-ΡΠΎ ΡΠ΅ΠΊΡΡ Π² Π±Π»ΠΎΠΊΠ΅, ΠΌΠΎΠΆΠ΅Ρ Π±ΡΡΡ ΠΊΠΎΡΠΎΡΠΊΠΈΠΉ ΠΈΠ»ΠΈ Π΄Π»ΠΈΠ½Π½ΡΠΉ</p> </div> </div> The left property, which is applied to a text container, centers it, but decreases width by the value described in this property (50% in this case), but the container needs to be width depending on the content, but not wider than 310px, which described by the max-width property. How to achieve this?