Aligning a list of links to the right within its container - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Parent Container

Description

Aligning a list of links to the right within its container

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">
.boxLeft {<!-- www  . j av  a 2s. c  om-->
   display:inline-block;
   width:201px;
   height:201px;
   background-color:Chartreuse;
   float:left;
}

.linksArea {
   text-align:center;
   font-size:2.3em;
   font-weight:bold;
}

.linksArea a {
   display:block;
   background-color:yellow;
   width:21em;
   margin-bottom:0.6em;
   padding-top:.7em;
   padding-bottom:.7em;
   clear:right;
   float:right;
}
</style> 
 </head> 
 <body> 
  <div class="linksArea" style="width: 800px;"> 
   <div class="boxLeft"></div> 
   <a href="google.com">Link1</a> 
   <br> 
   <a href="google.com">Link2</a> 
   <br> 
   <a href="google.com">Link3</a> 
   <br> 
   <a href="google.com">Link4</a> 
   <br> 
   <a href="google.com">Link5</a> 
   <br> 
   <a href="google.com">Link6</a> 
  </div>  
 </body>
</html>

Related Tutorials