SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Feb 2002
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question What am I missing?

    ok..

    i am attempting to format something like..

    Code:
    xxxx                                 yyyy
    aaaa                                 bbbb
    yadda yadda yadda yadda yadda yadda yadda 
    yadda yadda yadda yadda yadda yadda yadda
    I have been trying stuff similar to:

    Code:
    <div style="display: block; background-color: silver;">
       <div style="float: left;">
          xxxx<br/>
          aaaa
       </div>
       <div style="float: right; text-align: right;">
          yyyy<br/>
          bbbb
       </div>
    </div>
    <div style="display: block;">
       yadda yadda yadda yadda yadda yadda yadda 
       yadda yadda yadda yadda yadda yadda yadda
    </div>
    It almost works, except the yaddas flow up the middle of the aligned headers. There is apparently something about the box model that I am missing, I just haven't been able to figure out what. Any ideas how I can fix this?

    Thanks!

  2. #2
    blonde.... Sarah's Avatar
    Join Date
    Jul 2001
    Location
    Berkshire, UK
    Posts
    7,442
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    This isn't a real solution just a fix, but see what you think of the code below:


    <div style="float: left;border:solid;width:50">
    xxxx<br/>
    aaaa
    </div>
    <div style="float: right; text-align: right;border:solid;width:50">
    yyyy<br/>
    bbbb
    </div>

    <div style="border:solid;margin:60,50,0,50">
    yadda yadda yadda yadda yadda yadda yadda <br>
    yadda yadda yadda yadda yadda yadda yadda
    </div>

    The borders show quite well how the div is working with yours the div was using up the whole space including the space with the other divs in it hence why it moved up, using the margin tags only really works for fixed widths, and also don't know if you'll have set widths for the aaa sides too?

    As NS 4.xx doesn't like margin this might not be a good idea but it still works you just get space around them.

    sorry can't help more but this at least works (also took out a div, plus the background color didn't show up need to put into each seperate div)

    this was using Win NT IE5.5

    good luck

    Sarah
    Regular user


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
  •