SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    ********* Janitor levik's Avatar
    Join Date
    Jan 2003
    Location
    New York
    Posts
    885
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Silly layout issue

    OK... This is fairly frustrating... I need to lay out some text in a div followed by a couple of characters that would be right-aligned.

    the effext I am going for is this:
    Code:
     +--------------------------------------+
     |Some Text                            X|
     +--------------------------------------+
    where the "X" is right aligned. I am pretty sure this ought to be possible using this type of code:
    Code:
    <div>
         Some text
         <[div/span/p/whatever] style="???">X</[close previous tag>
    </div>
    But after numerous attempts, I am yet to find a magic combination that will work. For one reason or another, the X is either not aligned to the right of the containing div, or gets wrapped to another line.

    Any ideas?

  2. #2
    ********* Janitor levik's Avatar
    Join Date
    Jan 2003
    Location
    New York
    Posts
    885
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would really love to avoid using tables (it would make things significantly more complex for me).

    Also, unfortunately I cannot use your suggested code, since I do not know the dimentions of the div to start off - I will have a bunch of "rows" like this, and they will all have to be as long as the longest of the bunch.

  3. #3
    SitePoint Zealot tcwatts's Avatar
    Join Date
    Jan 2003
    Location
    .my
    Posts
    131
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    levik,

    sorry i removed my post cause it did not show up correctly on the browser, only on DW. I'll poke around some more and see if I can hack this.

  4. #4
    ********* Janitor levik's Avatar
    Join Date
    Jan 2003
    Location
    New York
    Posts
    885
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I ended up finding a solution that's roundabout at best:

    Code:
    <div align="right">
            <span style="float:left;">Some text</span>
            X
    </div>
    The problem is that float:right which I tried putting arround X would stretch my DIV out all the way to the right edge of the browser window (the DIV is of the position:absolute persuasion) Apparently this doesn't take place with float:left.


Bookmarks

Posting Permissions

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