position two elements inside an anchor tag - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:2 Column

Description

position two elements inside an anchor tag

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">
.nav {<!--from   w  ww. j  ava  2s  . co  m-->
   width:100%;
   height:201px;
   margin:0 auto;
   position:absolute;
}

.nav .menu {
   height:201px;
   list-style-type:none;
   text-align:center;
}

.nav .menu li {
   letter-spacing:0.2em;
   display:inline-block;
   padding-left:111px;
   padding-right:111px;
   position:relative;
}

.nav .menu li.current_page_item a {
   text-decoration:underline;
}

.nav .menu li a:hover {
   color:Chartreuse;
}

.nav .menu li a p {
   font-size:2em;
}

.nav .menu li a div {
   width:151px;
   height:100px;
   background-color:yellow;
   display:
}
</style> 
 </head> 
 <body> 
  <div class="nav"> 
   <ul id="menu-navigation-bar" class="menu"> 
    <li class="menu-item-72"> <a href="http://localhost:8888/wordpress/about/"> <p>Lorem</p> 
      <div></div> </a> </li> 
    <li class="menu-item-71"> <a href="http://localhost:8888/wordpress/services/"> <p>Lorem ip</p> 
      <div></div> </a> </li> 
    <li class="menu-item-70"> <a href="http://localhost:8888/wordpress/work/"> <p>Lore</p> 
      <div></div> </a> </li> 
    <li class="menu-item-69"> <a href="http://localhost:8888/wordpress/contact/"> <p>Lorem i</p> 
      <div></div> </a> </li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials