# Float elements to right in div tbl?

**URL:** <https://forum.kirupa.com/t/float-elements-to-right-in-div-tbl/311910>\
**Category:** web dev\
**Created:** [July 20, 2010, 10:26am UTC](https://forum.kirupa.com/t/float-elements-to-right-in-div-tbl/311910 "2010-07-20T10:26:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stephsh](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@stephsh](https://forum.kirupa.com/u/stephsh)\
**Post date:** [July 20, 2010, 10:26am UTC](https://forum.kirupa.com/t/float-elements-to-right-in-div-tbl/311910/1 "2010-07-20T10:26:56Z")

</div>

I have created a placeholder with three elements in it. I want the elements to be positioned to the right hand side of the placeholder. A big margin however appears between the element positioned most to the right (logoutBtn) and the end of the placeholder div table. Using a webdesigning tool I however saw that no element was positioned there.

Any suggestions on how I could remove this? The name of the user logging on (in this case “testuser Azubiportal”) always changes so I don’t want to set an exact position for each element, I prefer to use float.

screenshot with comments:  
[[COLOR=#810081]http://attitudeasbl.webs.com/ComNetMedia%20Images/CSSerror.png[/COLOR]](http://attitudeasbl.webs.com/ComNetMedia%20Images/CSSerror.png)

Stylesheet:

```php

(...)
.placeholder {
height: 23px;
width: 768px;
border-top: dashed 1px #3A9DCB;
border-bottom: dashed 1px #3A9DCB;
background-color: #f6f6f6;
}
.logoutBtn {
position: relative;
float: right; 
font-size: smaller;
padding-top: 4px;
text-align: right;
}
.loginName 
{
position: relative;
float: right; 
font-size:smaller;
padding-top: 4px; 
}
.logAs {
float: right;
position: relative;
font-size:smaller;
color: #3A9DCB;
padding-top: 4px;
}

```
