Please rate!
What mistakes are made? How can you improve the layout?
h3, p { margin: 0; } .box { font-family: sans-serif; position: relative; width: 100%; min-height: 35px; } .box_title { position: relative; display: inline-block; max-width: 250px; padding: 5px 15px; min-height: 35px; border: 2px solid #93d81c; border-bottom: none; border-radius: 10px 10px 0 0; background: #c9e39c; } .box_title::before { position: absolute; content: ''; z-index: -10; top: 0; left: 0; display: block; width: 100%; height: 100%; border-radius: 10px 10px 0 0; box-shadow: 0 0 6px 1px rgba(0, 0, 0, .7); } .box_text { position: absolute; z-index: -5; top: 100%; left: 0; width: 100%; box-sizing: border-box; min-height: 150px; margin-top: -2px; padding: 10px 15px 0; border: 2px solid #93d81c; border-radius: 0 0 10px 10px; background: #c9e39c; box-shadow: 0 0 6px 0 rgba(0,0,0, .5); } <div class="box"> <h3 class="box-item box_title">Заголовок</h3> <p class="box-item box_text"> Содержание блока </p> </div>
border-top,border-leftandborder-rightcarry in one border, and then writeborder-bottom: 0. It is pure, that instead of three, there were two lines :) And it is advisable not to assign anything toz-indexnegative. In some browsers it does not look correct - Yuri