html - Make a div inside another its header -
this 1 little difficult explain: have 1 div within another, inside div supposed act header containing div. problem need padding in containing div, contained adjust padding. how keep padding of container, have contained snap top, left , right 0 margin?
here's code:
<div class="notification"> <div class="notification_head"> <p>testing notification.</p> </div> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. aenean congue nibh vel velit posuere, eu rhoncus purus interdum. praesent urna metus, mollis sed blandit ut, bibendum @ neque. aenean nulla metus, faucibus eget metus pharetra, ullamcorper placerat quam. aenean euismod sagittis hendrerit. integer vel dolor nibh. nulla dignissim lacinia orci eget pellentesque. donec id scelerisque metus. proin eleifend finibus tellus @ malesuada. praesent bibendum, est bibendum sagittis dignissim, mi magna imperdiet quam, nec laoreet massa ante et arcu. sed imperdiet nec dolor vitae eleifend. duis non velit faucibus purus hendrerit dapibus sit amet id est. in consequat dapibus ornare. sed vel leo purus.</p> </div>
and css:
.notification { border: 1px solid #fc2929; border-radius: 7px; padding: 0 2% 2% 2%; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } .notification .notification_head { width: 100%; background: #fc2929; color: #ffffff; display: inline-block; padding: 0.5%; }
this looks like:
you need create div
text , make padding/margins want.
.notification { border: 1px solid #fc2929; border-radius: 7px; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } .notification .notification_head{ width: 100%; background: #fc2929; color: #ffffff; display: inline-block; } .notification_text { margin: 15px; }
<div class="notification"> <div class="notification_head"> <p>testing notification.</p> </div> <div class="notification_text"> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. aenean congue nibh vel velit posuere, eu rhoncus purus interdum. praesent urna metus, mollis sed blandit ut, bibendum @ neque. aenean nulla metus, faucibus eget metus pharetra, ullamcorper placerat quam. aenean euismod sagittis hendrerit. integer vel dolor nibh. nulla dignissim lacinia orci eget pellentesque. donec id scelerisque metus. proin eleifend finibus tellus @ malesuada. praesent bibendum, est bibendum sagittis dignissim, mi magna imperdiet quam, nec laoreet massa ante et arcu. sed imperdiet nec dolor vitae eleifend. duis non velit faucibus purus hendrerit dapibus sit amet id est. in consequat dapibus ornare. sed vel leo purus.</p> </div> </div>
Comments
Post a Comment