Positioning and Overflow with CSS - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Position

Description

Positioning and Overflow with CSS

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
#panel-notice {<!--from   ww w.  ja v a 2 s .c  o  m-->
   position:fixed;
   opacity:0.96;
   background-color:Chartreuse;
   top:9px;
   left:6%;
   right:6%;
   min-width:501px;
   border-radius:6px;
   box-shadow:4px 4px 6px 0px hsla(0, 0%, 0%, 0.51);
   cursor:pointer;
   z-index:201;
}

#panel-notice>* {
   margin:0px;
   padding:9px;
   color:yellow;
}

#panel-notice>p#close {
   font-weight:bold;
   position:absolute;
   top:51%;
   right:0px;
}

#panel-notice>p#message {
   display:inline-block;
   text-align:left;
   border:2px solid blue;
   width:81%
}
</style> 
 </head> 
 <body> 
  <div id="panel-notice"> 
   <p id="close">Lorem</p> 
   <p id="message">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliquam erat volutpat. Vestibulum tortor neque, ornare vitae tempor hendrerit, luctus at neque. Phasellus sed quam pharetra, tincidunt tortor in, pharetra nisl. Maecenas aliquam luctus mauris, vitae venenatis diam imperdiet vel. Donec tortor diam, pretium vitae nibh vitae, consectetur lacinia sem. Proin luctus facilisis volutpat. Ut semper sit amet purus quis ornare. Quisque lobortis neque vitae tempor iaculis. Aliquam erat volutpat. Mauris tincidunt eget lacus eget pulvinar. Suspendisse potenti. Maecenas blandit tempus metus, eu ornare eros egestas sit amet. Cras et arcu eget massa porta porttitor eget ac neque. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliquam erat volutpat. Vestibulum tortor neque, ornare vitae tempor hendrerit, luctus at neque. Phasellus sed quam pharetra, tincidunt tortor in, pharetra nisl. Maecenas aliquam luctus mauris, vitae venenatis diam imperdiet vel. Donec tortor diam, pretium vitae nibh vitae, consectetur lacinia sem. Proin luctus facilisis volutpat. </p> 
  </div>  
 </body>
</html>

Related Tutorials