CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2010
    Posts
    130

    [RESOLVED] Float ASP.NET elements to right in div tbl?

    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:
    http://attitudeasbl.webs.com/ComNetM...s/CSSerror.png

    Stylesheet:
    Code:
    (...)
    .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;
    }

  2. #2
    Join Date
    Jun 2009
    Posts
    35

    Re: Float ASP.NET elements to right in div tbl?

    Additional space is created due to possible flaws in your "outer" layer or table's set properties (an additional column exists somewhere while no span of row or col has been called yet),
    this is not aASP fault, its a design one

  3. #3
    Join Date
    Jan 2010
    Posts
    130

    Re: Float ASP.NET elements to right in div tbl?

    Didnt know that was possible!

    I messed around some more and changed the "float" property of the three elements to "inherit" and added the property "float: right" to the div containing those elements... now it works!

    Do you know why one also has to specify the property in the div?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured