Aligning text to bottom left corner inside a styled-element - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Text

Description

Aligning text to bottom left corner inside a styled-element

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">
body {<!--from   ww w  .j  a v a 2s.  co  m-->
   font-family:Verdana;
   font-size:17px;
   color:Chartreuse;
}

.box {
   height:188px;
   width:188px;
   margin-right:6.6px;
   margin-left:6.6px;
   margin-bottom:6.6px;
   margin-top:6.6px;
   color:yellow;
   position:relative;
}

.box>span {
   position:absolute;
   bottom:0;
   left:0;
}
</style> 
 </head> 
 <body> 
  <h1>example text</h1> 
  <article class="box" style="background-color: #2672EC"> 
   <span>foo bar</span> 
  </article> 
  <h1>example text</h1>  
 </body>
</html>

Related Tutorials