Valentin Despa
Valentin Despa

Reputation: 42562

Position div right to a table

I have the following layout:

enter image description here

I want to position the div right to the table. I would like to control the vertical (relative to the top) and horizontal (relative to the vertical center of the page).

Anybody willing to drop a working CSS example?

Current status using jsfiddle

Upvotes: 1

Views: 1632

Answers (1)

Rohit Azad Malik
Rohit Azad Malik

Reputation: 32172

I think you want this

Css

.contant{
width:200px;
  height:200px;
  border:solid 3px red;
  position:relative;
}
.out{
width:50px;
  height:50px;
  border:solid 3px green;
position:absolute;  right:-65px;
  top:100px;
}

HTML

<div class="contant">

  <div class="out"></div>

</div>

Live demo

Updated -----------------Now you can used to this -----

<table>
<tr>
<td>
<div class="contant"> 
<div class="out"></div>        
</div>
</td>
 </tr>
 </table> 

Upvotes: 3

Related Questions